[Zodb-checkins] CVS: Packages/bsddb3Storage - test_virgin.py:1.3

barry@digicool.com barry@digicool.com
Fri, 30 Mar 2001 14:48:44 -0500 (EST)


Update of /cvs-repository/Packages/bsddb3Storage/test
In directory korak:/tmp/cvs-serv32742

Modified Files:
	test_virgin.py 
Log Message:
NewInsertsTest => MinimalNewInsertsTest

FullNewInsertsTest: new class which mirrors MinimalNewInsertsTest and
performs the same set of tests on the Full database.

Also add some better docstrings.

Added __main__ section so this test can be run standalone.



--- Updated File test_virgin.py in package Packages/bsddb3Storage --
--- test_virgin.py	2001/03/16 23:57:26	1.2
+++ test_virgin.py	2001/03/30 19:48:43	1.3
@@ -1,16 +1,17 @@
 # Test creation of a brand new database, and insertion of root objects.
 
 import unittest
-from test_create import BaseFramework
+import test_create
 
 
 
-class NewInsertsTest(BaseFramework):
+class FullNewInsertsTest(test_create.FullBaseFramework):
     def checkIsEmpty(self):
-        """Checks that a newly created database is empty"""
+        """Full: Newly created database should be empty"""
         assert not self._root.has_key('names')
 
     def checkNewInserts(self):
+        """Full: Commiting on a newly created database"""
         from BTree import BTree
 
         self._root['names'] = names = BTree()
@@ -20,8 +21,31 @@
 
 
 
+class MinimalNewInsertsTest(test_create.MinimalBaseFramework):
+    def checkIsEmpty(self):
+        """Minimal: Newly created database is empty"""
+        assert not self._root.has_key('names')
+
+    def checkNewInserts(self):
+        """Minimal: Committing on a newly created database"""
+        from BTree import BTree
+
+        self._root['names'] = names = BTree()
+        names['Warsaw'] = 'Barry'
+        names['Hylton'] = 'Jeremy'
+        get_transaction().commit()
+
+
+
 def suite():
     suite = unittest.TestSuite()
-    suite.addTest(NewInsertsTest('checkIsEmpty'))
-    suite.addTest(NewInsertsTest('checkNewInserts'))
+    suite.addTest(MinimalNewInsertsTest('checkIsEmpty'))
+    suite.addTest(MinimalNewInsertsTest('checkNewInserts'))
+    suite.addTest(FullNewInsertsTest('checkIsEmpty'))
+    suite.addTest(FullNewInsertsTest('checkNewInserts'))
     return suite
+
+
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')