[Zope3-checkins] CVS: Zope3/src/zope/app/dav/tests -
test_directives.py:1.1.2.1
Philipp von Weitershausen
philikon at philikon.de
Wed Aug 6 11:28:19 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/dav/tests
In directory cvs.zope.org:/tmp/cvs-serv14946/dav/tests
Modified Files:
Tag: zcml-interface-field-branch
test_directives.py
Log Message:
Fix up tests to use the ConfigurationMachine from zope.app.configure which
is service-aware.
=== Zope3/src/zope/app/dav/tests/test_directives.py 1.1 => 1.1.2.1 ===
--- Zope3/src/zope/app/dav/tests/test_directives.py:1.1 Sat Aug 2 13:26:15 2003
+++ Zope3/src/zope/app/dav/tests/test_directives.py Wed Aug 6 10:27:45 2003
@@ -17,20 +17,22 @@
"""
import unittest
-from zope.app.dav.globaldavschemaservice import davSchemaService
-from zope.app.interfaces.component import IDAVSchemaService
-from zope.app.services.servicenames import DAVSchema
from zope.component.service import defineService, serviceManager
from zope.component.tests.placelesssetup import PlacelessSetup
from zope.configuration import xmlconfig
from zope.interface import Interface
+
import zope.app.dav.tests
+import zope.app.configuration
+import zope.app.component.service
+
+from zope.app.dav.globaldavschemaservice import davSchemaService
+from zope.app.interfaces.component import IDAVSchemaService
+from zope.app.services.servicenames import DAVSchema
-
class ISchema(Interface):
pass
-
class DirectivesTest(PlacelessSetup, unittest.TestCase):
def setUp(self):
@@ -38,12 +40,19 @@
defineService(DAVSchema, IDAVSchemaService)
serviceManager.provideService(DAVSchema, davSchemaService)
+ def _config(self):
+ sm = zope.app.component.service.globalServiceManager()
+ context = zope.app.configuration.ConfigurationMachine(sm)
+ xmlconfig.registerCommonDirectives(context)
+ xmlconfig.file('dav.zcml', package=zope.app.dav.tests,
+ context=context)
+ self._context = context
+
def test_provideInterface(self):
self.assertEqual(davSchemaService.queryNamespace(ISchema), None)
- self.context = xmlconfig.file("dav.zcml", zope.app.dav.tests)
+ self._config()
self.assertEqual(davSchemaService.queryNamespace(ISchema),
'http://www.zope3.org/dav-schema')
-
def test_suite():
return unittest.TestSuite((
More information about the Zope3-Checkins
mailing list