[Zope-Checkins] CVS: Zope3/lib/python/Zope/Security/tests - testChecker.py:1.1.2.3

Jim Fulton jim@zope.com
Thu, 18 Apr 2002 20:34:57 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv20751/lib/python/Zope/Security/tests

Modified Files:
      Tag: SecurityProxy-branch
	testChecker.py 
Log Message:
added check_setattr implementation to Checker

=== Zope3/lib/python/Zope/Security/tests/testChecker.py 1.1.2.2 => 1.1.2.3 ===
         self.assertEqual(checker.permission_id('_z'), None)
 
+    def test_setattr(self):
+        checker = NamesChecker(['a', 'b', 'c', '__getitem__'],
+                               'test_allowed')
+
+        for inst in NewInst(), OldInst():
+            self.assertRaises(Forbidden, checker.check_setattr, inst, 'a')
+            self.assertRaises(Forbidden, checker.check_setattr, inst, 'z')
+
 
 
 def test_suite():