[Zope-Checkins] CVS: Zope3/lib/python/Zope/Security/tests - testChecker.py:1.1.2.5
Jim Fulton
jim@zope.com
Mon, 22 Apr 2002 19:11:45 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv20113/lib/python/Zope/Security/tests
Modified Files:
Tag: SecurityProxy-branch
testChecker.py
Log Message:
Changed the checker to make some attributes:
'__lt__', '__le__', '__eq__', '__gt__', '__ge__', '__ne__',
'__hash__', '__nonzero__', '__class__', and '__implements__'
always public.
=== Zope3/lib/python/Zope/Security/tests/testChecker.py 1.1.2.4 => 1.1.2.5 ===
self.assertEqual(checker.permission_id('z'), 'p')
self.assertEqual(checker.permission_id('_z'), None)
+
+ def testAlwaysAvailable(self):
+ from Zope.Security.Checker import NamesChecker
+ checker = NamesChecker(())
+ class C: pass
+ self.assertEqual(checker.check(C, '__hash__'), None)
+ self.assertEqual(checker.check(C, '__nonzero__'), None)
+ self.assertEqual(checker.check(C, '__class__'), None)
+ self.assertEqual(checker.check(C, '__implements__'), None)
+ self.assertEqual(checker.check(C, '__lt__'), None)
+ self.assertEqual(checker.check(C, '__le__'), None)
+ self.assertEqual(checker.check(C, '__gt__'), None)
+ self.assertEqual(checker.check(C, '__ge__'), None)
+ self.assertEqual(checker.check(C, '__eq__'), None)
+ self.assertEqual(checker.check(C, '__ne__'), None)
def test_setattr(self):
checker = NamesChecker(['a', 'b', 'c', '__getitem__'],