[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - testio.py:1.6 testscanner.py:1.4 zope2testbase.py:1.7

Shane Hathaway shane at zope.com
Tue Feb 17 00:25:43 EST 2004


Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv17338/lib/apelib/tests

Modified Files:
	testio.py testscanner.py zope2testbase.py 
Log Message:
Another big pile of changes resulted from a little time. :-)

>From CHANGES.txt:

  - Removed the concepts of "classified state" and "hints", now
    relying on the existing concepts of classification and state.  This
    primarily involved changes to classifiers and the apelib.core.io
    module.

  - Implemented the folder item classification optimization.  Now,
    when Ape loads a folder, it passes along the classification of each
    subitem as part of the containing folder's state.  This means fewer
    round-trips.

Also fixed a couple of shallow bugs that prevented Ape from starting in 
Zope.



=== Products/Ape/lib/apelib/tests/testio.py 1.5 => 1.6 ===
--- Products/Ape/lib/apelib/tests/testio.py:1.5	Mon Feb  2 10:07:22 2004
+++ Products/Ape/lib/apelib/tests/testio.py	Tue Feb 17 00:25:12 2004
@@ -62,10 +62,10 @@
         oid = 'test'
         obj_db = self.getObjectDatabase()
         obsys = io.ObjectSystemIO(self.conf, obj_db)
-        event, classified_state = obsys.serialize(oid, ob)
+        event, classification, state = obsys.serialize(oid, ob)
 
-        ob2 = obsys.newObject(classified_state)
-        obsys.deserialize(oid, ob2, classified_state)
+        ob2 = obsys.newObject(classification)
+        obsys.deserialize(oid, ob2, classification, state)
         self.assertEqual(ob.strdata, ob2.strdata)
         self.assertEqual(ob.data, ob2.data)
 
@@ -80,12 +80,12 @@
         obj_db = self.getObjectDatabase()
         obsys = io.ObjectSystemIO(self.conf, obj_db)
         gwsys = io.GatewayIO(self.conf, self.conns)
-        event, classified_state = obsys.serialize(oid, ob)
-        gwsys.store(oid, classified_state, True)
+        event, classification, state = obsys.serialize(oid, ob)
+        gwsys.store(oid, classification, state, True)
 
-        event, cs, hash_value = gwsys.load(oid)
-        ob2 = obsys.newObject(cs)
-        obsys.deserialize(oid, ob2, cs)
+        event, classification, state, hash_value = gwsys.load(oid)
+        ob2 = obsys.newObject(classification)
+        obsys.deserialize(oid, ob2, classification, state)
         self.assertEqual(ob.strdata, ob2.strdata)
         self.assertEqual(ob.data, ob2.data)
 


=== Products/Ape/lib/apelib/tests/testscanner.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/tests/testscanner.py:1.3	Mon Feb  2 10:07:22 2004
+++ Products/Ape/lib/apelib/tests/testscanner.py	Tue Feb 17 00:25:12 2004
@@ -126,6 +126,13 @@
         to_invalidate = self.scanner.scan()
         self.assertEqual(len(to_invalidate), 1)
 
+    def testPoolScan(self):
+        self.conn1.setOIDs([5])
+        new_sources = {(self.repo, '6'): 0, (self.repo, '7'): 0, }
+        self.scanner.afterLoad(5, new_sources)
+        # Just test that ctl.scan() executes without error.
+        self.ctl.scan()
+
     def testPruneFuture(self):
         # Simulate some data.
         self.scanner.future[5] = ([], time())  # Should not be pruned


=== Products/Ape/lib/apelib/tests/zope2testbase.py 1.6 => 1.7 ===
--- Products/Ape/lib/apelib/tests/zope2testbase.py:1.6	Mon Feb  2 10:07:22 2004
+++ Products/Ape/lib/apelib/tests/zope2testbase.py	Tue Feb 17 00:25:12 2004
@@ -307,9 +307,9 @@
                 self.assertEqual(f.float1, 3.14)
                 self.assertEqual(f.int1, 5)
                 self.assertEqual(f.long1, 2L**33)
-                self.assertEqual(f.date1, now)
+                self.assertEqual(f.date1.ISO(), now.ISO())
                 if INTL_DATES:
-                    self.assertEqual(f.date2, now)
+                    self.assertEqual(f.date2.ISO(), now.ISO())
                 self.assertEqual(f.text1, 'abc\ndef')
                 self.assertEqual(f.boolean0, 0)
                 self.assertEqual(f.boolean1, 1)




More information about the Zope-CVS mailing list