[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_ <content> -> <class>

Philipp von Weitershausen philikon at philikon.de
Thu Mar 16 12:20:08 EST 2006


Log message for revision 66060:
  <content>  ->  <class>
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_contentdirective.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_contentdirective.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_contentdirective.py	2006-03-16 15:56:25 UTC (rev 66059)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_contentdirective.py	2006-03-16 17:20:08 UTC (rev 66060)
@@ -49,9 +49,9 @@
       </configure>
       """ % s)
 
-class TestContentDirective(PlacelessSetup, unittest.TestCase):
+class TestClassDirective(PlacelessSetup, unittest.TestCase):
     def setUp(self):
-        super(TestContentDirective, self).setUp()
+        super(TestClassDirective, self).setUp()
         XMLConfig('meta.zcml', zope.app.component)()
         XMLConfig('meta.zcml', zope.app.security)()
 
@@ -62,8 +62,8 @@
 
     def testEmptyDirective(self):
         f = configfile("""
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
-</content>
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
+</class>
                        """)
         xmlconfig(f)
 
@@ -73,9 +73,9 @@
             "zope.app.component.tests.exampleclass.IExample"), None)
 
         f = configfile("""
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
   <implements interface="zope.app.component.tests.exampleclass.IExample" />
-</content>
+</class>
                        """)
         xmlconfig(f)
         self.failUnless(IExample.implementedBy(ExampleClass))
@@ -91,12 +91,12 @@
             "zope.app.component.tests.exampleclass.IExample2"), None)
 
         f = configfile("""
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
   <implements interface="
            zope.app.component.tests.exampleclass.IExample
            zope.app.component.tests.exampleclass.IExample2
                        " />
-</content>
+</class>
                        """)
         xmlconfig(f)
         self.failUnless(IExample.implementedBy(ExampleClass))
@@ -111,26 +111,26 @@
     def testRequire(self):
         f = configfile("""
 <permission id="zope.View" title="Zope view permission" />
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
     <require permission="zope.View"
                       attributes="anAttribute anotherAttribute" />
-</content>
+</class>
                        """)
         xmlconfig(f)
 
     def testAllow(self):
         f = configfile("""
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
     <allow attributes="anAttribute anotherAttribute" />
-</content>
+</class>
                        """)
         xmlconfig(f)
 
     def testMimic(self):
         f = configfile("""
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
     <require like_class="zope.app.component.tests.exampleclass.ExampleClass" />
-</content>
+</class>
                        """)
         xmlconfig(f)
 
@@ -145,13 +145,13 @@
         f = configfile("""
 <permission id="zope.Foo" title="Zope Foo Permission" />
 
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
   <factory
       id="test.Example"
       title="Example content"
       description="Example description"
       />
-</content>
+</class>
                        """)
         xmlconfig(f)
         factory = zapi.getUtility(IFactory, 'test.Example')
@@ -162,12 +162,12 @@
         f = configfile("""
 <permission id="zope.Foo" title="Zope Foo Permission" />
 
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
     <factory
       title="Example content"
       description="Example description"
     />
-</content>
+</class>
                        """)
         xmlconfig(f)
         self.assertRaises(ComponentLookupError, zapi.getUtility, IFactory, 
@@ -181,13 +181,13 @@
     def testFactoryPublicPermission(self):
 
         f = configfile("""
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
     <factory
       id="test.Example"
       title="Example content"
       description="Example description"
     />
-</content>
+</class>
             """)
         xmlconfig(f)
         factory = zapi.getUtility(IFactory, 'test.Example')
@@ -197,7 +197,7 @@
 def test_suite():
     suite = unittest.TestSuite()
     loader = unittest.TestLoader()
-    suite.addTest(loader.loadTestsFromTestCase(TestContentDirective))
+    suite.addTest(loader.loadTestsFromTestCase(TestClassDirective))
     suite.addTest(loader.loadTestsFromTestCase(TestFactorySubdirective))
     return suite
 

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py	2006-03-16 15:56:25 UTC (rev 66059)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/component/tests/test_directives.py	2006-03-16 17:20:08 UTC (rev 66060)
@@ -1412,13 +1412,13 @@
     def testFactory(self):
         f = configfile('''
 <permission id="zope.Foo" title="Zope Foo Permission" />
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
+<class class="zope.app.component.tests.exampleclass.ExampleClass">
     <factory
       id="test.Example"
       title="Example content"
       description="Example description"
        />
-</content>''')
+</class>''')
         xmlconfig(f)
         obj = createObject('test.Example')
         self.failUnless(zapi.isinstance(obj, exampleclass.ExampleClass))
@@ -1486,11 +1486,11 @@
     # inherently sets the instances as well as the class attributes.
 
     def testSimpleMethodsPlural(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 attributes="m1 m3"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1))
         self.assertDeclaration(declaration, m1P=P1, m3P=P1)
 
@@ -1508,11 +1508,11 @@
         self.assertSetattrState(**state)
 
     def test_set_attributes(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 set_attributes="m1 m3"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1))
         apply_declaration(module.template_bracket % declaration)
         checker = selectChecker(module.test_instance)
@@ -1524,11 +1524,11 @@
 
         self.assertEqual(queryInterface(PREFIX+"S"), None)
 
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 set_schema="%s"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1, PREFIX+"S"))
         apply_declaration(module.template_bracket % declaration)
 
@@ -1548,11 +1548,11 @@
         self.assertEqual(queryInterface(PREFIX+"S"), None)
         self.assertEqual(queryInterface(PREFIX+"S2"), None)
 
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 set_schema="%s %s"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1, PREFIX+"S", PREFIX+"S2"))
         apply_declaration(module.template_bracket % declaration)
 
@@ -1574,11 +1574,11 @@
 
         self.assertEqual(queryInterface(PREFIX+"I"), None)
 
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 interface="%s"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1, PREFIX+"I"))
         # m1 and m2 are in the interface, so should be set, and m3 should not:
         self.assertDeclaration(declaration, m1P=P1, m2P=P1)
@@ -1592,12 +1592,12 @@
         self.assertEqual(queryInterface(PREFIX+"I3"), None)
         self.assertEqual(queryInterface(PREFIX+"I4"), None)
 
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 interface="  %s
                                              %s  "/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1, PREFIX+"I3", PREFIX+"I4"))
         self.assertDeclaration(declaration, m3P=P1, m2P=P1)
 
@@ -1611,10 +1611,10 @@
 
     def testCompositeNoPerm(self):
         # Establish rejection of declarations lacking a permission spec.
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 attributes="m1"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class"))
         self.assertRaises(ZopeXMLConfigurationError,
                           self.assertDeclaration,
@@ -1623,46 +1623,46 @@
 
 
     def testCompositeMethodsPluralElementPerm(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 attributes="m1 m3"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1))
         self.assertDeclaration(declaration,
                                m1P=P1, m3P=P1)
 
     def testCompositeInterfaceTopPerm(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 interface="%s"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1, PREFIX+"I"))
         self.assertDeclaration(declaration,
                                m1P=P1, m2P=P1)
 
 
     def testSubInterfaces(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 interface="%s"/>
-                          </content>'''
+                          </class>'''
                        % (PREFIX+"test_class", P1, PREFIX+"I2"))
         # m1 and m2 are in the interface, so should be set, and m3 should not:
         self.assertDeclaration(declaration, m1P=P1, m2P=P1)
 
 
     def testMimicOnly(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 attributes="m1 m2"/>
-                          </content>
-                          <content class="%s">
+                          </class>
+                          <class class="%s">
                             <require like_class="%s" />
-                          </content>
+                          </class>
                           ''' % (PREFIX+"test_base", P1,
                 PREFIX+"test_class", PREFIX+"test_base"))
         # m1 and m2 are in the interface, so should be set, and m3 should not:
@@ -1671,17 +1671,17 @@
 
 
     def testMimicAsDefault(self):
-        declaration = ('''<content class="%s">
+        declaration = ('''<class class="%s">
                             <require
                                 permission="%s"
                                 attributes="m1 m2"/>
-                          </content>
-                          <content class="%s">
+                          </class>
+                          <class class="%s">
                             <require like_class="%s" />
                             <require
                                 permission="%s"
                                 attributes="m2 m3"/>
-                          </content>
+                          </class>
                           ''' % (PREFIX+"test_base", P1,
                 PREFIX+"test_class", PREFIX+"test_base", P2))
 



More information about the Zope3-Checkins mailing list