[Zope3-checkins] CVS: Zope3/src/zope/app/onlinehelp/tests - test_helpdirectives.py:1.5.2.1

Philipp von Weitershausen philikon at philikon.de
Wed Aug 6 11:28:25 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/onlinehelp/tests
In directory cvs.zope.org:/tmp/cvs-serv14946/onlinehelp/tests

Modified Files:
      Tag: zcml-interface-field-branch
	test_helpdirectives.py 
Log Message:
Fix up tests to use the ConfigurationMachine from zope.app.configure which
is service-aware.


=== Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py 1.5 => 1.5.2.1 ===
--- Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py:1.5	Sat Aug  2 07:19:25 2003
+++ Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py	Wed Aug  6 10:27:50 2003
@@ -17,22 +17,24 @@
 """
 import unittest
 
+from zope.configuration import xmlconfig
+from zope.interface import Interface
+from zope.component.adapter import provideAdapter
+from zope.component.tests.placelesssetup import PlacelessSetup
+
+import zope.app.configuration
+import zope.app.component.service
+
 from zope.app.interfaces.traversing import \
      ITraverser, ITraversable, IPhysicallyLocatable
 from zope.app.onlinehelp import tests
 from zope.app.onlinehelp import help
 from zope.app.traversing.adapters import \
      Traverser, DefaultTraversable, WrapperPhysicallyLocatable
-from zope.component.adapter import provideAdapter
-from zope.component.tests.placelesssetup import PlacelessSetup
-from zope.configuration import xmlconfig
-from zope.interface import Interface
-
 
 class I1(Interface):
     pass
 
-
 class DirectivesTest(PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
@@ -41,12 +43,18 @@
         provideAdapter(None, ITraversable, DefaultTraversable)
         provideAdapter(None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
 
+    def _config(self):
+        sm = zope.app.component.service.globalServiceManager()
+        context = zope.app.configuration.ConfigurationMachine(sm)
+        xmlconfig.registerCommonDirectives(context)
+        xmlconfig.file('help.zcml', package=tests, context=context)
+        self._context = context
+
     def test_register(self):
         self.assertEqual(help.keys(), [])
-        self.context = xmlconfig.file("help.zcml", tests)
+        self._config()
         self.assertEqual(help.keys(), ['help1'])
         self.assertEqual(help._registry[(I1, 'view.html')][0].title, 'Help')
-
 
 def test_suite():
     return unittest.TestSuite((




More information about the Zope3-Checkins mailing list