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

Martijn Pieters mj at zopatista.com
Sun Sep 25 18:28:26 EDT 2005


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

Modified Files:
      Tag: Zope-2_7-branch
	testPrefix.py 
Log Message:
Fix for Collector #1810: A previous bugfix (#1726) broke listing undoable
transactions for users defined in a non-root acl_users folder. Zope logs a
acl_users path together with a username (separated by a space) and this
previous fix failed to take this into account. Fixed by taking anything after
the last space in the compared path out of the equation.


=== Packages/ZopeUndo/tests/testPrefix.py 1.1.66.2 => 1.1.66.3 ===
--- Packages/ZopeUndo/tests/testPrefix.py:1.1.66.2	Wed Apr 27 14:57:45 2005
+++ Packages/ZopeUndo/tests/testPrefix.py	Sun Sep 25 18:28:26 2005
@@ -44,5 +44,19 @@
         p = Prefix(string)
         self.assertEqual(p.value, (len(string), string))
 
+    def test_username_info(self):
+        # Zope Collector 1810; user paths have username appended
+        p1 = Prefix('/a/b')
+        for equal in ('/a/b spam', '/a/b/c spam', '/a/b/c/b spam'):
+            self.assertEqual(p1, equal)
+        for notEqual in (" spam", "/a/c spam", "/a/bbb spam", "/// spam"):
+            self.assertNotEqual(p1, notEqual)
+
+        p2 = Prefix("")
+        for equal in (" eggs", "/ eggs", "/def eggs", "/a/b eggs", 
+                      "/a/b/c eggs", "/a/b/c/d eggs"):
+            self.assertEqual(p2, equal)
+
+
 def test_suite():
     return unittest.makeSuite(PrefixTest)



More information about the Zodb-checkins mailing list