Mercurial > p > roundup > code
comparison test/test_db.py @ 1519:6fede2aa6a12
added ability to restore retired nodes
| author | Andrey Lebedev <kedder@users.sourceforge.net> |
|---|---|
| date | Sun, 16 Mar 2003 22:24:56 +0000 |
| parents | 8b698780bb7d |
| children | 63aa7be52d2c |
comparison
equal
deleted
inserted
replaced
| 1518:bb843662b708 | 1519:6fede2aa6a12 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: test_db.py,v 1.76 2003-03-10 18:16:42 kedder Exp $ | 18 # $Id: test_db.py,v 1.77 2003-03-16 22:24:56 kedder Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, time | 20 import unittest, os, shutil, time |
| 21 | 21 |
| 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ | 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 23 Interval, DatabaseError, Boolean, Number, Node | 23 Interval, DatabaseError, Boolean, Number, Node |
| 284 # can still access the node if necessary | 284 # can still access the node if necessary |
| 285 self.assertEqual(self.db.status.get('1', 'name'), b) | 285 self.assertEqual(self.db.status.get('1', 'name'), b) |
| 286 self.db.commit() | 286 self.db.commit() |
| 287 self.assertEqual(self.db.status.get('1', 'name'), b) | 287 self.assertEqual(self.db.status.get('1', 'name'), b) |
| 288 self.assertNotEqual(a, self.db.status.list()) | 288 self.assertNotEqual(a, self.db.status.list()) |
| 289 # try to restore retired node | |
| 290 self.db.status.restore('1') | |
| 291 self.assertEqual(a, self.db.status.list()) | |
| 289 | 292 |
| 290 def testSerialisation(self): | 293 def testSerialisation(self): |
| 291 nid = self.db.issue.create(title="spam", status='1', | 294 nid = self.db.issue.create(title="spam", status='1', |
| 292 deadline=date.Date(), foo=date.Interval('-1d')) | 295 deadline=date.Date(), foo=date.Interval('-1d')) |
| 293 self.db.commit() | 296 self.db.commit() |
