[Zodb-checkins] CVS: Packages/ZopeUndo/tests - testPrefix.py:1.1.66.2

Tim Peters tim.one at comcast.net
Wed Apr 27 14:57:46 EDT 2005


Update of /cvs-repository/Packages/ZopeUndo/tests
In directory cvs.zope.org:/tmp/cvs-serv17930/ZopeUndo/tests

Modified Files:
      Tag: Zope-2_7-branch
	testPrefix.py 
Log Message:
Turns out the change snuck into ZopeUndo.Prefix created critical
ZEO compatibility bugs.  This will force a ZODB 3.2.8 release.  Good
thing Andreas didn't release Zope 2.7.6 yet!


=== Packages/ZopeUndo/tests/testPrefix.py 1.1.66.1 => 1.1.66.2 ===
--- Packages/ZopeUndo/tests/testPrefix.py:1.1.66.1	Wed Mar 30 02:47:42 2005
+++ Packages/ZopeUndo/tests/testPrefix.py	Wed Apr 27 14:57:45 2005
@@ -27,6 +27,22 @@
         p2 = Prefix("")
         for equal in ("", "/", "/def", "/a/b", "/a/b/c", "/a/b/c/d"):
             self.assertEqual(p2, equal)
-      
+
+    def test_pre327_compat(self):
+        string = "a/b/"
+        p = Prefix(string)
+        # Prior to 3.2.7, Prefix had only a value attribute.  Make sure
+        # an old-format Prefix gets converted to new-format automagically.
+        length, path = p.length, p.path
+        del p.length, p.path
+        p.value = len(string), string
+        self.assertEqual(repr(p), "Prefix('" + string + "')")
+        self.assertEqual(p.length, length)
+        self.assertEqual(p.path, path)
+
+        # Ensure the pre-3.2.7 .value attribute gets created too.
+        p = Prefix(string)
+        self.assertEqual(p.value, (len(string), string))
+
 def test_suite():
     return unittest.makeSuite(PrefixTest)



More information about the Zodb-checkins mailing list