Commit 0433880f authored by Andreas Jung's avatar Andreas Jung

forgotten to commit additional test for memory leak in cAccessControl

parent 4526638b
......@@ -86,6 +86,16 @@ class TestGuardedGetattr(GuardTestCase):
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment