[Zope-Checkins] CVS: Zope/lib/python/OFS/tests - testObjectManager.py:1.5

Zachery Bir zbir at urbanape.com
Thu Mar 18 14:00:56 EST 2004


Update of /cvs-repository/Zope/lib/python/OFS/tests
In directory cvs.zope.org:/tmp/cvs-serv13567

Modified Files:
	testObjectManager.py 
Log Message:
  - remove unnecessary additional complexity from the FauxUser (we
    don't test any of that here.)

  - include a test suite declaration

  - slight clarification on some of the test names and content ids


=== Zope/lib/python/OFS/tests/testObjectManager.py 1.4 => 1.5 ===
--- Zope/lib/python/OFS/tests/testObjectManager.py:1.4	Wed Mar 17 18:50:56 2004
+++ Zope/lib/python/OFS/tests/testObjectManager.py	Thu Mar 18 14:00:56 2004
@@ -25,44 +25,11 @@
 
         self._id = id
         self._login = login
-        self._roles = {}
-        self._groups = {}
 
     def getId( self ):
 
         return self._id
 
-    def getUserName( self ):
-
-        return self._login
-
-    def getRoles( self ):
-
-        return self._roles
-
-    def getGroups( self ):
-
-        return self._groups
-
-    def allowed( self, value, roles ):
-
-        return 1
-
-    def _addRoles( self, roles ):
-
-        for role in roles:
-            self._roles[role] = 1
-
-    def _addGroups(self, groups):
-        
-        for group in groups:
-            self._groups[group] = 1
-
-    def __repr__( self ):
-
-        return '<FauxUser: %s>' % self._id
-
-
 class ObjectManagerTests( unittest.TestCase ):
 
     def tearDown( self ):
@@ -132,7 +99,7 @@
 
         self.assertEqual( si.__ac_local_roles__, None )
 
-    def test_setObject_set_owner_with_simple_user( self ):
+    def test_setObject_set_owner_with_user( self ):
 
         om = self._makeOne()
 
@@ -140,11 +107,11 @@
 
         newSecurityManager( None, user )
 
-        si = SimpleItem( 'faux_creation' )
+        si = SimpleItem( 'user_creation' )
 
         self.assertEqual( si.__ac_local_roles__, None )
 
-        om._setObject( 'faux_creation', si )
+        om._setObject( 'user_creation', si )
 
         self.assertEqual( si.__ac_local_roles__, { 'user': ['Owner'] } )
 
@@ -251,6 +218,11 @@
         om._setObject( 'should_be_okay', si, set_owner=0 )
 
         self.assertEqual( si.__ac_local_roles__, None )
+
+def test_suite():
+    suite = unittest.TestSuite()
+    suite.addTest( unittest.makeSuite( ObjectManagerTests ) )
+    return suite
 
 if __name__ == "__main__":
     unittest.main()




More information about the Zope-Checkins mailing list