[Zodb-checkins] CVS: Zope3/src/zodb/code/tests - test_class.py:1.1.4.2

Jeremy Hylton jeremy@zope.com
Tue, 21 Jan 2003 17:49:56 -0500


Update of /cvs-repository/Zope3/src/zodb/code/tests
In directory cvs.zope.org:/tmp/cvs-serv4021

Modified Files:
      Tag: new-pickle-branch
	test_class.py 
Log Message:
Extend testUpdateInPlace() to work with two connections.


=== Zope3/src/zodb/code/tests/test_class.py 1.1.4.1 => 1.1.4.2 ===
--- Zope3/src/zodb/code/tests/test_class.py:1.1.4.1	Tue Jan 21 17:37:23 2003
+++ Zope3/src/zodb/code/tests/test_class.py	Tue Jan 21 17:49:54 2003
@@ -110,10 +110,21 @@
         inst = testclass.Foo()
         self.assertEqual(inst.meth(4), 12)
 
+        Foo2 = self._load_name("testclass.Foo")
+        inst2 = Foo2()
+        self.assertEqual(inst2.meth(4), 12)
+
         self.registry.updateModule("testclass", self.update_in_place2)
         get_transaction().commit()
         self.assertEqual(inst.meth(4), 7)
-        
+
+        # The old instance's connection hasn't processed the
+        # invalidation yet.
+        self.assertEqual(inst2.meth(4), 12)
+        self.assertEqual(Foo2().meth(4), 12)
+        inst2.__class__._p_jar.sync()
+        self.assertEqual(inst2.meth(4), 7)
+        self.assertEqual(Foo2().meth(4), 7)
 
 def test_suite():
     return unittest.makeSuite(TestClass)