[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser/tests - test_globalbrowsermenuservice.py:1.14 test_globalbrowsermenuservicedirectives.py:1.10

Jim Fulton cvs-admin at zope.org
Wed Dec 3 00:42:05 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv19258/src/zope/app/publisher/browser/tests

Modified Files:
	test_globalbrowsermenuservice.py 
	test_globalbrowsermenuservicedirectives.py 
Log Message:
Added extra data to browser menu items to accomidate the needs of
add menus.

Changed menu item data to use objects rather than tuples to store the 
data,


=== Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservice.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservice.py:1.13	Tue Sep 23 21:52:33 2003
+++ Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservice.py	Wed Dec  3 00:41:34 2003
@@ -55,7 +55,8 @@
     return {'action': "a%s" % n,
             'title':  "t%s" % n,
             'description':  "d%s" % n,
-            'selected': ''
+            'selected': '',
+            'extra': None
             }
 
 
@@ -144,7 +145,8 @@
             return {'action': "a%s" % n,
                     'title':  "t%s" % n,
                     'description':  "d%s" % n,
-                    'selected': selected}
+                    'selected': selected,
+                    'extra': None}
 
         menu = r.getMenu('test_id', TestObject(),
             TestRequest(SERVER_URL='http://127.0.0.1/a1', PATH_INFO='/a1'))
@@ -179,7 +181,8 @@
             return {'action': "a%s" % s,
                     'title':  "t%s" % s,
                     'description':  "d%s" % s,
-                    'selected': selected}
+                    'selected': selected,
+                    'extra': None}
 
         menu = r.getMenu('test_id', TestObject(),
             TestRequest(SERVER_URL='http://127.0.0.1/aA', PATH_INFO='/aA'))
@@ -215,11 +218,13 @@
         r.menuItem('test_id', I12, 'a9', 't9', 'd9')
 
         def d(n):
-            return ('a%s' %n, 't%s' %n, 'd%s' %n, None, None) 
+            return ('a%s' %n, 't%s' %n, 'd%s' %n, None, None, None) 
 
-        menu = r.getAllMenuItems('test_id', TestObject())
-        self.assertEqual(list(menu), [d(5), d(6), d(7), d(8), d(3),
-                                      d(2), d(1)])
+        menu = [(item.action, item.title, item.description,
+                 item.filter, item.permission, item.extra)
+                for item in r.getAllMenuItems('test_id', TestObject())
+                ]
+        self.assertEqual(menu, [d(5), d(6), d(7), d(8), d(3), d(2), d(1)])
 
 
 


=== Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservicedirectives.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservicedirectives.py:1.9	Thu Nov 27 08:59:23 2003
+++ Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservicedirectives.py	Wed Dec  3 00:41:34 2003
@@ -95,7 +95,8 @@
             return {'action': "a%s" % n,
                     'title':  "t%s" % n,
                     'description':  "",
-                    'selected': ''
+                    'selected': '',
+                    'extra': None,
                     }
 
         self.assertEqual(list(menu), [d(5), d(6), d(3), d(2), d(1)])




More information about the Zope3-Checkins mailing list