[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testProtectClass.py:1.1.2.12 testPublicClass.py:1.1.2.12

Casey Duncan casey@zope.com
Wed, 3 Apr 2002 15:44:11 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	testProtectClass.py testPublicClass.py 
Log Message:
Zope configuration now uses Shane's nifty traceback supplements to sprinkle
helpful debug info into exceptions that occur during configuration processing,
rather than masking them with a single generic configuration exception. 

Exception formatting is now turned on during testing, and when config is run
at startup.


=== Zope3/lib/python/Zope/App/Security/tests/testProtectClass.py 1.1.2.11 => 1.1.2.12 ===
         declaration = ("""<security:protectClass name="%s" />"""
                        % (PREFIX+"test_class"))
-        self.assertRaises(ZopeXMLConfigurationError,
+        self.assertRaises(protectClass.ProtectionDeclarationException,
                           self.assertDeclaration,
                           declaration)
 
@@ -139,7 +139,7 @@
                                <security:protect methods="m1"/>
                              </security:protectClass>"""
                        % (PREFIX+"test_class"))
-        self.assertRaises(ZopeXMLConfigurationError,
+        self.assertRaises(protectClass.ProtectionDeclarationException,
                           self.assertDeclaration,
                           declaration)
         # Permission not in top tag and in one subtag but not in the other:
@@ -149,7 +149,7 @@
                                <security:instances/>
                              </security:protectClass>"""
                           % (PREFIX+"test_class", P1))
-        self.assertRaises(ZopeXMLConfigurationError,
+        self.assertRaises(protectClass.ProtectionDeclarationException,
                           self.assertDeclaration,
                           declaration)
 


=== Zope3/lib/python/Zope/App/Security/tests/testPublicClass.py 1.1.2.11 => 1.1.2.12 ===
 # So we can use config parser to exercise publicClass stuff.
 from cStringIO import StringIO
-from Zope.Configuration.xmlconfig import xmlconfig, ZopeXMLConfigurationError
+from Zope.Configuration.xmlconfig import xmlconfig
+from Zope.Configuration.meta import InvalidDirective
 from TestModuleHookup import *
 
 NOTSET = []
@@ -85,7 +86,7 @@
         declaration = (template_bracket
                        % """<security:publicClass name="%s"
                                permission_id="X"/>""")
-        self.assertRaises(ZopeXMLConfigurationError,
+        self.assertRaises(InvalidDirective,
                           self.assertDeclaration,
                           declaration)