changeset 4804:3cea38408fe6

Groups2009: GroupManager.__init__ takes arbitrary number of backends.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 11 Jun 2009 14:02:19 +0200
parents 167db6117bb4
children 6a109416e2b2
files MoinMoin/_tests/wikiconfig_groups.py MoinMoin/groups/__init__.py MoinMoin/groups/_tests/test_group_manager.py MoinMoin/groups/_tests/test_group_manager_acl.py MoinMoin/groups/backends/_tests/test_config_group.py MoinMoin/groups/backends/_tests/test_wiki_group.py
diffstat 6 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/wikiconfig_groups.py	Thu Jun 11 13:48:54 2009 +0200
+++ b/MoinMoin/_tests/wikiconfig_groups.py	Thu Jun 11 14:02:19 2009 +0200
@@ -11,6 +11,6 @@
 from MoinMoin.groups.backends import wiki_group
 
 class Config(LocalConfig):
-    group_manager_init = lambda self, request: GroupManager([wiki_group.Backend(request)])
+    group_manager_init = lambda self, request: GroupManager(wiki_group.Backend(request))
     config_groups = {}
 
--- a/MoinMoin/groups/__init__.py	Thu Jun 11 13:48:54 2009 +0200
+++ b/MoinMoin/groups/__init__.py	Thu Jun 11 14:02:19 2009 +0200
@@ -12,7 +12,7 @@
     GroupManager manages several group backends.
     """
 
-    def __init__(self, backends):
+    def __init__(self, *backends):
         """
         Create a group manager object.
 
--- a/MoinMoin/groups/_tests/test_group_manager.py	Thu Jun 11 13:48:54 2009 +0200
+++ b/MoinMoin/groups/_tests/test_group_manager.py	Thu Jun 11 14:02:19 2009 +0200
@@ -41,8 +41,8 @@
                                  u'AdminGroup': second_admin_group}
 
         def group_manager_init(self, request):
-            return GroupManager(backends=[config_group.Backend(request, self.first_backend_groups),
-                                          config_group.Backend(request, self.second_backend_groups)])
+            return GroupManager(config_group.Backend(request, self.first_backend_groups),
+                                config_group.Backend(request, self.second_backend_groups))
 
     def setup_method(self, method):
         self.groups = self.request.groups
--- a/MoinMoin/groups/_tests/test_group_manager_acl.py	Thu Jun 11 13:48:54 2009 +0200
+++ b/MoinMoin/groups/_tests/test_group_manager_acl.py	Thu Jun 11 14:02:19 2009 +0200
@@ -24,7 +24,7 @@
             groups = {u'FirstGroup': frozenset([u"ExampleUser", u"SecondUser", u"JoeDoe"]),
                       u'SecondGroup': frozenset([u"ExampleUser", u"ThirdUser"])}
 
-            return GroupManager(backends=[config_group.Backend(request, groups)])
+            return GroupManager(config_group.Backend(request, groups))
 
     def testConfigBackendAcl(self):
         """
--- a/MoinMoin/groups/backends/_tests/test_config_group.py	Thu Jun 11 13:48:54 2009 +0200
+++ b/MoinMoin/groups/backends/_tests/test_config_group.py	Thu Jun 11 14:02:19 2009 +0200
@@ -22,7 +22,7 @@
 
         def group_manager_init(self, request):
             self.config_groups = BackendTest.test_groups
-            return GroupManager(backends=[config_group.Backend(request)])
+            return GroupManager(config_group.Backend(request))
 
 
 coverage_modules = ['MoinMoin.groups.backends.config_group']
--- a/MoinMoin/groups/backends/_tests/test_wiki_group.py	Thu Jun 11 13:48:54 2009 +0200
+++ b/MoinMoin/groups/backends/_tests/test_wiki_group.py	Thu Jun 11 14:02:19 2009 +0200
@@ -30,7 +30,7 @@
     class Config(wikiconfig.Config):
 
         def group_manager_init(self, request):
-            return GroupManager(backends=[wiki_group.Backend(request)])
+            return GroupManager(wiki_group.Backend(request))
 
     def test_CamelCase(self):
         text = """
@@ -88,7 +88,7 @@
     class Config(wikiconfig.Config):
 
         def group_manager_init(self, request):
-            return GroupManager(backends=[wiki_group.Backend(request)])
+            return GroupManager(wiki_group.Backend(request))
 
     def setup_class(self):
         become_trusted(self.request)