[Checkins] SVN: z3c.securitytool/trunk/src/z3c/securitytool/README.txt Changed the test for roleTree to pass with both the normal tests and

Daniel Blackburn blackburnd at gmail.com
Tue Feb 26 19:28:54 EST 2008


Log message for revision 84291:
  Changed the test for roleTree to pass with both the normal tests and
  the coverage tests. The result was a list so the order was different
  between tests. converted to a dict.
  
  cleanup of other whitespace 
  
  

Changed:
  U   z3c.securitytool/trunk/src/z3c/securitytool/README.txt

-=-
Modified: z3c.securitytool/trunk/src/z3c/securitytool/README.txt
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/README.txt	2008-02-27 00:27:25 UTC (rev 84290)
+++ z3c.securitytool/trunk/src/z3c/securitytool/README.txt	2008-02-27 00:28:53 UTC (rev 84291)
@@ -287,37 +287,50 @@
                                        {'permission': 'concord.DeleteArticle',
                                         'principal': 'zope.daniel',
                                         'setting': PermissionSetting: Deny}]}}]
-    
 
-
-
     >>> pprint(matrix['permissions'])
-    [{'setting': PermissionSetting: Allow, 'permission': 'concord.CreateArticle'},
-     {'setting': PermissionSetting: Deny, 'permission': 'concord.ReadIssue'},
-     {'setting': PermissionSetting: Allow, 'permission': 'concord.DeleteIssue'},
-     {'setting': PermissionSetting: Deny, 'permission': 'concord.DeleteArticle'}]
+    [{'setting': PermissionSetting: Allow,
+      'permission': 'concord.CreateArticle'},
+     {'setting': PermissionSetting: Deny,
+      'permission': 'concord.ReadIssue'},
+     {'setting': PermissionSetting: Allow,
+      'permission': 'concord.DeleteIssue'},
+     {'setting': PermissionSetting: Deny,
+      'permission': 'concord.DeleteArticle'}]
 
+The roleTree is stored as a list so to consistently view the data
+properly we will create a dictionary out of it.    
+    >>> tmpDict = {}
+    >>> keys = matrix['roleTree']
+    >>> for item in matrix['roleTree']:
+    ...     tmpDict.update(item)
 
 
-    >>> pprint(matrix['roleTree'])
-    [{u'Folder1_2': {'name': None,
-                     'parentList': [u'Folder1', 'Root Folder'],
-                     'roles': [{'principal': 'zope.daniel',
-                                'role': 'zope.Writer',
-                                'setting': PermissionSetting: Allow}]}},
-     {'Root  Folder': {'name': 'Root  Folder',
-                       'parentList': ['Root Folder'],
-                       'roles': [{'principal': 'zope.daniel',
-                                  'role': 'zope.Writer',
-                                  'setting': PermissionSetting: Allow}]}},
-     {'global settings': {'name': None,
-                          'parentList': ['global settings'],
-                          'roles': [{'principal': 'zope.daniel',
-                                     'role': 'zope.Janitor',
-                                     'setting': PermissionSetting: Allow}]}}]
+    >>> pprint(tmpDict['Root Folder'])
+    {'name': 'Root Folder',
+     'parentList': ['Root Folder'],
+     'roles': [{'principal': 'zope.daniel',
+                'role': 'zope.Writer',
+                'setting': PermissionSetting: Allow}]}
     
+    >>> pprint(tmpDict['Folder1_2'])
+    {'name': None,
+     'parentList': [u'Folder1', 'Root Folder'],
+     'roles': [{'principal': 'zope.daniel',
+                'role': 'zope.Writer',
+                'setting': PermissionSetting: Allow}]}
 
+    >>> pprint(tmpDict['global settings'])
+    {'name': None,
+     'parentList': ['global settings'],
+     'roles': [{'principal': 'zope.daniel',
+                'role': 'zope.Janitor',
+                'setting': PermissionSetting: Allow}]}
+    
+    
 
+
+
     >>> pprint(matrix['roles'])
     {'zope.Janitor': [{'setting': 'Allow', 'permission': 'concord.ReadIssue'}],
      'zope.Writer': [{'setting': 'Allow', 'permission': 'concord.DeleteArticle'},
@@ -431,5 +444,8 @@
   >>> manager.open('http://localhost:8080/@@permissionDetails.html?principal=zope.daniel')
 
 
+And now with a view name that does not exist
+  >>> manager.open('http://localhost:8080/@@permissionDetails.html?principal=zope.daniel&view=garbage')
+
 Lets also test with a different context level
   >>> manager.open('http://localhost:8080/Folder1/Folder2/Folder3/@@permissionDetails.html?principal=zope.daniel&view=ReadIssue.html')



More information about the Checkins mailing list