[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py forgotten to commit additional test for memory leak in cAccessControl

Andreas Jung andreas at andreas-jung.com
Wed Aug 3 04:23:56 EDT 2005


Log message for revision 37678:
  forgotten to commit additional test for memory leak in cAccessControl
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py	2005-08-03 08:23:14 UTC (rev 37677)
+++ Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py	2005-08-03 08:23:56 UTC (rev 37678)
@@ -86,6 +86,16 @@
     def tearDown(self):
         self.setSecurityManager(self.__old)
 
+    def test_unauthorized(self):
+        obj, name = Method(), 'args'
+        value = getattr(obj, name)
+        rc = sys.getrefcount(value)
+        self.__sm.reject = True
+        self.assertRaises(Unauthorized, guarded_getattr, obj, name)
+        self.assert_(self.__sm.calls)
+        del self.__sm.calls[:]
+        self.assertEqual(rc, sys.getrefcount(value))
+
     def test_calls_validate_for_unknown_type(self):
         guarded_getattr(self, 'test_calls_validate_for_unknown_type')
         self.assert_(self.__sm.calls)



More information about the Zope-Checkins mailing list