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

Paul Winkler pw_lists at slinkp.com
Wed Mar 30 02:47:43 EST 2005


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

Modified Files:
      Tag: Zope-2_7-branch
	testPrefix.py 
Log Message:
Backported slinkp_1726_zopeundo branch from svn.
Avoid showing transactions in the wrong folder's undo log.


=== Packages/ZopeUndo/tests/testPrefix.py 1.1 => 1.1.66.1 ===
--- Packages/ZopeUndo/tests/testPrefix.py:1.1	Thu Oct  3 13:41:52 2002
+++ Packages/ZopeUndo/tests/testPrefix.py	Wed Mar 30 02:47:42 2005
@@ -4,7 +4,7 @@
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
@@ -18,19 +18,15 @@
 class PrefixTest(unittest.TestCase):
 
     def test(self):
-        p1 = (Prefix("/a/b"),
-              ("/a/b", "/a/b/c", "/a/b/c/d"),
-              ("", "/a/c"))
-
-        p2 = (Prefix(""),
-              ("", "/def", "/a/b", "/a/b/c", "/a/b/c/d"),
-              ())
-
-        for prefix, equal, notequal in p1, p2:
-            for s in equal:
-                self.assertEqual(prefix, s)
-            for s in notequal:
-                self.assertNotEqual(prefix, s)
-
+        p1 = Prefix("/a/b")
+        for equal in ("/a/b", "/a/b/c", "/a/b/c/d"):
+            self.assertEqual(p1, equal)
+        for notEqual in ("", "/a/c", "/a/bbb", "///"):
+            self.assertNotEqual(p1, notEqual)
+
+        p2 = Prefix("")
+        for equal in ("", "/", "/def", "/a/b", "/a/b/c", "/a/b/c/d"):
+            self.assertEqual(p2, equal)
+      
 def test_suite():
     return unittest.makeSuite(PrefixTest)



More information about the Zodb-checkins mailing list