[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - testio.py:1.4 testserialization.py:1.5

Shane Hathaway shane at zope.com
Thu Aug 14 17:20:11 EDT 2003


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

Modified Files:
	testio.py testserialization.py 
Log Message:
Fixed mapping comparison.

It turns out that PersistentMapping.__cmp__() doesn't work anymore
in Python 2.1!  As a workaround, compare internal state instead.


=== Products/Ape/lib/apelib/tests/testio.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/tests/testio.py:1.3	Wed Jul 30 17:33:08 2003
+++ Products/Ape/lib/apelib/tests/testio.py	Thu Aug 14 16:20:05 2003
@@ -69,7 +69,7 @@
         ob2 = obsys.newObject(classified_state)
         obsys.deserialize(keychain, ob2, classified_state)
         self.assertEqual(ob.strdata, ob2.strdata)
-        self.assertEqual(ob, ob2)
+        self.assertEqual(ob.data, ob2.data)
 
 
     def testStoreAndLoad(self):
@@ -89,7 +89,7 @@
         ob2 = obsys.newObject(cs)
         obsys.deserialize(keychain, ob2, cs)
         self.assertEqual(ob.strdata, ob2.strdata)
-        self.assertEqual(ob, ob2)
+        self.assertEqual(ob.data, ob2.data)
 
 
     def testExportImport(self):
@@ -114,8 +114,8 @@
         self.assert_(root is not roota)
         self.assert_(root['TestRoot'] is not roota['TestRoot'])
         self.assert_(root['TestRoot2'] is not roota['TestRoot2'])
-        self.assertEqual(root['TestRoot'], roota['TestRoot'])
-        self.assertEqual(root['TestRoot2'], roota['TestRoot2'])
+        self.assertEqual(root['TestRoot'].data, roota['TestRoot'].data)
+        self.assertEqual(root['TestRoot2'].data, roota['TestRoot2'].data)
         self.assertEqual(root['TestRoot'].strdata, roota['TestRoot'].strdata)
         self.assertEqual(root['TestRoot2'].leftover,
                          roota['TestRoot2'].leftover)


=== Products/Ape/lib/apelib/tests/testserialization.py 1.4 => 1.5 ===
--- Products/Ape/lib/apelib/tests/testserialization.py:1.4	Sat Aug  9 11:16:36 2003
+++ Products/Ape/lib/apelib/tests/testserialization.py	Thu Aug 14 16:20:05 2003
@@ -52,7 +52,7 @@
         event = DeserializationEvent(kos, mapper, ('',), ob2)
         mapper.getSerializer().deserialize(ob2, event, full_state)
         self.assertEqual(ob.strdata, ob2.strdata)
-        self.assertEqual(ob, ob2)
+        self.assertEqual(ob.data, ob2.data)
 
     def testStoreAndLoad(self):
         ob = PersistentMapping()
@@ -72,7 +72,7 @@
         event = DeserializationEvent(kos, mapper, ('',), ob2)
         mapper.getSerializer().deserialize(ob2, event, full_state)
         self.assertEqual(ob.strdata, ob2.strdata)
-        self.assertEqual(ob, ob2)
+        self.assertEqual(ob.data, ob2.data)
 
     def testCatchExtraAttribute(self):
         ob = PersistentMapping()




More information about the Zope-CVS mailing list