comparison tests/test_db.py @ 88:168def1ce74d

consistency
author Richard Jones <richard@users.sourceforge.net>
date Fri, 27 Jul 2001 06:23:59 +0000
parents d3dcac043ab0
children 76803679598f
comparison
equal deleted inserted replaced
87:d3dcac043ab0 88:168def1ce74d
1 # $Id: test_db.py,v 1.5 2001-07-27 06:23:09 richard Exp $ 1 # $Id: test_db.py,v 1.6 2001-07-27 06:23:59 richard Exp $
2 2
3 import unittest, os, shutil 3 import unittest, os, shutil
4 4
5 from roundup.backends import anydbm 5 from roundup.backends import anydbm
6 from roundup.hyperdb import String, Link, Multilink, Date, Interval, Class, \ 6 from roundup.hyperdb import String, Link, Multilink, Date, Interval, Class, \
135 self.db = Database('_test_dir') 135 self.db = Database('_test_dir')
136 setupSchema(self.db, 0) 136 setupSchema(self.db, 0)
137 137
138 def testExceptions(self): 138 def testExceptions(self):
139 # this tests the exceptions that should be raised 139 # this tests the exceptions that should be raised
140 self.assertRaises(DatabaseError, self.db.status.create, name="foo") 140 ar = self.assertRaises
141 self.assertRaises(DatabaseError, self.db.status.set, '1', name="foo") 141
142 self.assertRaises(DatabaseError, self.db.status.retire, '1') 142 # this tests the exceptions that should be raised
143 ar(DatabaseError, self.db.status.create, name="foo")
144 ar(DatabaseError, self.db.status.set, '1', name="foo")
145 ar(DatabaseError, self.db.status.retire, '1')
143 146
144 147
145 def suite(): 148 def suite():
146 db = unittest.makeSuite(DBTestCase, 'test') 149 db = unittest.makeSuite(DBTestCase, 'test')
147 readonlydb = unittest.makeSuite(ReadOnlyDBTestCase, 'test') 150 readonlydb = unittest.makeSuite(ReadOnlyDBTestCase, 'test')
148 return unittest.TestSuite((db, readonlydb)) 151 return unittest.TestSuite((db, readonlydb))
149 152
150 153
151 # 154 #
152 # $Log: not supported by cvs2svn $ 155 # $Log: not supported by cvs2svn $
156 # Revision 1.5 2001/07/27 06:23:09 richard
157 # Added some new hyperdb tests to make sure we raise the right exceptions.
158 #
153 # Revision 1.4 2001/07/25 04:34:31 richard 159 # Revision 1.4 2001/07/25 04:34:31 richard
154 # Added id and log to tests files... 160 # Added id and log to tests files...
155 # 161 #
156 # 162 #

Roundup Issue Tracker: http://roundup-tracker.org/