1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: test_db.py,v 1.33 2002-07-18 11:50:58 richard Exp $
18+ # $Id: test_db.py,v 1.34 2002-07-18 11:52:00 richard Exp $
1919
2020import unittest , os , shutil , time
2121
@@ -73,7 +73,7 @@ def setUp(self):
7373 self .db2 = anydbm .Database (config , 'test' )
7474 setupSchema (self .db2 , 0 , anydbm )
7575
76- def xtestStringChange (self ):
76+ def testStringChange (self ):
7777 self .db .issue .create (title = "spam" , status = '1' )
7878 self .assertEqual (self .db .issue .get ('1' , 'title' ), 'spam' )
7979 self .db .issue .set ('1' , title = 'eggs' )
@@ -88,13 +88,13 @@ def xtestStringChange(self):
8888 self .db .commit ()
8989 self .assertEqual (self .db .issue .get ('2' , 'title' ), 'ham' )
9090
91- def xtestLinkChange (self ):
91+ def testLinkChange (self ):
9292 self .db .issue .create (title = "spam" , status = '1' )
9393 self .assertEqual (self .db .issue .get ('1' , "status" ), '1' )
9494 self .db .issue .set ('1' , status = '2' )
9595 self .assertEqual (self .db .issue .get ('1' , "status" ), '2' )
9696
97- def xtestDateChange (self ):
97+ def testDateChange (self ):
9898 self .db .issue .create (title = "spam" , status = '1' )
9999 a = self .db .issue .get ('1' , "deadline" )
100100 self .db .issue .set ('1' , deadline = date .Date ())
@@ -104,7 +104,7 @@ def xtestDateChange(self):
104104 self .assertNotEqual (b , date .Date ('1970-1-1 00:00:00' ))
105105 self .db .issue .set ('1' , deadline = date .Date ())
106106
107- def xtestIntervalChange (self ):
107+ def testIntervalChange (self ):
108108 self .db .issue .create (title = "spam" , status = '1' )
109109 a = self .db .issue .get ('1' , "foo" )
110110 self .db .issue .set ('1' , foo = date .Interval ('-1d' ))
@@ -129,7 +129,7 @@ def testNumberChange(self):
129129 self .assertNotEqual (self .db .user .get ('1' , 'age' ), a )
130130 self .db .user .set ('1' , age = '1.0' )
131131
132- def xtestNewProperty (self ):
132+ def testNewProperty (self ):
133133 ' make sure a new property is added ok '
134134 self .db .issue .create (title = "spam" , status = '1' )
135135 self .db .issue .addprop (fixer = Link ("user" ))
@@ -141,7 +141,7 @@ def xtestNewProperty(self):
141141 'superseder' , 'title' ])
142142 self .assertEqual (self .db .issue .get ('1' , "fixer" ), None )
143143
144- def xtestRetire (self ):
144+ def testRetire (self ):
145145 self .db .issue .create (title = "spam" , status = '1' )
146146 b = self .db .status .get ('1' , 'name' )
147147 a = self .db .status .list ()
@@ -154,7 +154,7 @@ def xtestRetire(self):
154154 self .assertEqual (self .db .status .get ('1' , 'name' ), b )
155155 self .assertNotEqual (a , self .db .status .list ())
156156
157- def xtestSerialisation (self ):
157+ def testSerialisation (self ):
158158 self .db .issue .create (title = "spam" , status = '1' ,
159159 deadline = date .Date (), foo = date .Interval ('-1d' ))
160160 self .db .commit ()
@@ -165,7 +165,7 @@ def xtestSerialisation(self):
165165 self .db .commit ()
166166 assert isinstance (self .db .user .get ('1' , 'password' ), password .Password )
167167
168- def xtestTransactions (self ):
168+ def testTransactions (self ):
169169 # remember the number of items we started
170170 num_issues = len (self .db .issue .list ())
171171 num_files = self .db .numfiles ()
@@ -272,7 +272,7 @@ def testExceptions(self):
272272 # invalid boolean value
273273 ar (TypeError , self .db .user .set , '3' , username = 'foo' , assignable = 'fubar' )
274274
275- def xtestJournals (self ):
275+ def testJournals (self ):
276276 self .db .issue .addprop (fixer = Link ("user" , do_journal = 'yes' ))
277277 self .db .user .create (username = "mary" )
278278 self .db .user .create (username = "pete" )
@@ -341,7 +341,7 @@ def xtestJournals(self):
341341 # see if the change was journalled
342342 self .assertNotEqual (date_stamp , date_stamp2 )
343343
344- def xtestPack (self ):
344+ def testPack (self ):
345345 self .db .issue .create (title = "spam" , status = '1' )
346346 self .db .commit ()
347347 self .db .issue .set ('1' , status = '2' )
@@ -353,12 +353,12 @@ def xtestPack(self):
353353 journal = self .db .getjournal ('issue' , '1' )
354354 self .assertEqual (2 , len (journal ))
355355
356- def xtestIDGeneration (self ):
356+ def testIDGeneration (self ):
357357 id1 = self .db .issue .create (title = "spam" , status = '1' )
358358 id2 = self .db2 .issue .create (title = "eggs" , status = '2' )
359359 self .assertNotEqual (id1 , id2 )
360360
361- def xtestSearching (self ):
361+ def testSearching (self ):
362362 self .db .file .create (content = 'hello' , type = "text/plain" )
363363 self .db .file .create (content = 'world' , type = "text/frozz" ,
364364 comment = 'blah blah' )
@@ -373,7 +373,7 @@ def xtestSearching(self):
373373 self .assertEquals (self .db .indexer .search (['flebble' ], self .db .issue ),
374374 {'2' : {}, '1' : {}})
375375
376- def xtestReindexing (self ):
376+ def testReindexing (self ):
377377 self .db .issue .create (title = "frooz" )
378378 self .db .commit ()
379379 self .assertEquals (self .db .indexer .search (['frooz' ], self .db .issue ),
@@ -384,7 +384,7 @@ def xtestReindexing(self):
384384 {'1' : {}})
385385 self .assertEquals (self .db .indexer .search (['frooz' ], self .db .issue ), {})
386386
387- def xtestForcedReindexing (self ):
387+ def testForcedReindexing (self ):
388388 self .db .issue .create (title = "flebble frooz" )
389389 self .db .commit ()
390390 self .assertEquals (self .db .indexer .search (['flebble' ], self .db .issue ),
@@ -410,7 +410,7 @@ def setUp(self):
410410 self .db2 = anydbm .Database (config , 'test' )
411411 setupSchema (self .db2 , 0 , anydbm )
412412
413- def xtestExceptions (self ):
413+ def testExceptions (self ):
414414 ' make sure exceptions are raised on writes to a read-only db '
415415 # this tests the exceptions that should be raised
416416 ar = self .assertRaises
@@ -489,7 +489,7 @@ def setUp(self):
489489 self .db2 = metakit .Database (config , 'test' )
490490 setupSchema (self .db2 , 0 , metakit )
491491
492- def xtestTransactions (self ):
492+ def testTransactions (self ):
493493 # remember the number of items we started
494494 num_issues = len (self .db .issue .list ())
495495 self .db .issue .create (title = "don't commit me!" , status = '1' )
@@ -535,7 +535,7 @@ def suite():
535535 unittest .makeSuite (anydbmDBTestCase , 'test' ),
536536 unittest .makeSuite (anydbmReadOnlyDBTestCase , 'test' )
537537 ]
538- return unittest .TestSuite (l )
538+ # return unittest.TestSuite(l)
539539
540540 try :
541541 import bsddb
@@ -562,6 +562,9 @@ def suite():
562562
563563#
564564# $Log: not supported by cvs2svn $
565+ # Revision 1.33 2002/07/18 11:50:58 richard
566+ # added tests for number type too
567+ #
565568# Revision 1.32 2002/07/18 11:41:10 richard
566569# added tests for boolean type, and fixes to anydbm backend
567570#
0 commit comments