[Zope3-checkins] CVS: Zope3/src/zope/app/security/tests - test_permissionfield.py:1.4.2.1 test_securitydirectives.py:1.3.4.1 test_zopepolicy.py:1.1.2.1

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:42:00 -0500


Update of /cvs-repository/Zope3/src/zope/app/security/tests
In directory cvs.zope.org:/tmp/cvs-serv18615/src/zope/app/security/tests

Modified Files:
      Tag: paris-copypasterename-branch
	test_permissionfield.py test_securitydirectives.py 
	test_zopepolicy.py 
Log Message:
Updating from HEAD to make sure everything still works before merging

=== Zope3/src/zope/app/security/tests/test_permissionfield.py 1.4 => 1.4.2.1 ===
--- Zope3/src/zope/app/security/tests/test_permissionfield.py:1.4	Tue Jan 21 16:21:47 2003
+++ Zope3/src/zope/app/security/tests/test_permissionfield.py	Tue Feb 11 09:41:29 2003
@@ -24,13 +24,15 @@
 from zope.app.interfaces.security import IPermissionService
 from zope.component.service \
      import serviceManager, defineService
+from zope.component.servicenames import Permissions
+
 from zope.app.security.registries.permissionregistry import Permission
 
 class TestPermissionField(PlacelessSetup, TestCase):
 
     def test_validate(self):
-        defineService("Permissions", IPermissionService)
-        serviceManager.provideService("Permissions", permissionRegistry)
+        defineService(Permissions, IPermissionService)
+        serviceManager.provideService(Permissions, permissionRegistry)
         dummy = Permission('dummy', 'Dummy', 'Dummy permission')
         field = PermissionField()
         self.assertRaises(ValidationError, field.validate, dummy)


=== Zope3/src/zope/app/security/tests/test_securitydirectives.py 1.3 => 1.3.4.1 ===
--- Zope3/src/zope/app/security/tests/test_securitydirectives.py:1.3	Thu Dec 26 13:49:09 2002
+++ Zope3/src/zope/app/security/tests/test_securitydirectives.py	Tue Feb 11 09:41:29 2003
@@ -20,7 +20,7 @@
 from StringIO import StringIO
 
 from zope.component.service import serviceManager as services
-
+from zope.component.servicenames import Roles, Permissions, Authentication
 from zope.app.interfaces.security import IPermissionService
 from zope.app.interfaces.security import IRoleService
 from zope.app.interfaces.security import IAuthenticationService
@@ -54,14 +54,14 @@
 def setUp(self):
     CleanUp.setUp(self)
     
-    services.defineService('Permissions', IPermissionService)
-    services.provideService('Permissions', pregistry)
+    services.defineService(Permissions, IPermissionService)
+    services.provideService(Permissions, pregistry)
     
-    services.defineService('Roles', IRoleService)
-    services.provideService('Roles', rregistry)
+    services.defineService(Roles, IRoleService)
+    services.provideService(Roles, rregistry)
     
-    services.defineService('Authentication', IAuthenticationService)
-    services.provideService('Authentication', principalRegistry)
+    services.defineService(Authentication, IAuthenticationService)
+    services.provideService(Authentication, principalRegistry)
     
 
 class TestPrincipalDirective(CleanUp, unittest.TestCase):


=== Zope3/src/zope/app/security/tests/test_zopepolicy.py 1.1 => 1.1.2.1 ===
--- Zope3/src/zope/app/security/tests/test_zopepolicy.py:1.1	Mon Dec 30 22:35:12 2002
+++ Zope3/src/zope/app/security/tests/test_zopepolicy.py	Tue Feb 11 09:41:29 2003
@@ -27,6 +27,8 @@
 
 from zope.proxy.context import ContextWrapper
 from zope.component import getService
+from zope.component.servicenames import Roles, Permissions, Adapters
+from zope.component.servicenames import Authentication
 from zope.app.interfaces.security import IRolePermissionManager
 from zope.app.security.registries.permissionregistry import permissionRegistry
 from zope.app.security.registries.principalregistry import principalRegistry
@@ -76,18 +78,18 @@
         PlacefulSetup.setUp(self)
 
     
-        services.defineService('Permissions', IPermissionService)
-        services.provideService('Permissions', permissionRegistry)
+        services.defineService(Permissions, IPermissionService)
+        services.provideService(Permissions, permissionRegistry)
         
-        services.defineService('Roles', IRoleService)
-        services.provideService('Roles', roleRegistry)
+        services.defineService(Roles, IRoleService)
+        services.provideService(Roles, roleRegistry)
         
-        services.defineService('Authentication', IAuthenticationService)
-        services.provideService('Authentication', principalRegistry)
+        services.defineService(Authentication, IAuthenticationService)
+        services.provideService(Authentication, principalRegistry)
 
 
 
-        getService(None,"Adapters").provideAdapter(
+        getService(None,Adapters).provideAdapter(
                        IAttributeAnnotatable, IAnnotations,
                        AttributeAnnotations)
 
@@ -195,14 +197,14 @@
 
 
     def testUserWithRoles(self):
-        services.provideService('Authentication', AuthService(),force=True)
+        services.provideService(Authentication, AuthService(),force=True)
         self.failUnless(
             self.policy.checkPermission(self.write, None, Context(self.jim)))
         self.__assertPermissions(self.jim, ['create', 'read', 'write'])
 
 
     def testPlayfulPrincipalRole(self):
-        getService(None,"Adapters").provideAdapter(
+        getService(None,Adapters).provideAdapter(
             ITest,
             IPrincipalRoleManager, AnnotationPrincipalRoleManager)
 
@@ -221,7 +223,7 @@
     def testPlayfulRolePermissions(self):
 
         ARPM = AnnotationRolePermissionManager
-        getService(None,"Adapters").provideAdapter(ITest,
+        getService(None,Adapters).provideAdapter(ITest,
                             IRolePermissionManager, ARPM)
         test = permissionRegistry.definePermission('test', 'Test', '')
         test = test.getId()
@@ -278,7 +280,7 @@
 
     def testPlayfulPrinciplePermissions(self):
         APPM = AnnotationPrincipalPermissionManager
-        getService(None,"Adapters").provideAdapter(ITest,
+        getService(None,Adapters).provideAdapter(ITest,
                        IPrincipalPermissionManager, APPM)
 
         ob1 = TestClass()