[Zope3-checkins] CVS: Zope3/src/zope/app/process/tests - test_registerrequestfactory.py:1.3 test_registerservertype.py:1.3

Jim Fulton jim@zope.com
Mon, 28 Jul 2003 18:21:47 -0400


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

Modified Files:
	test_registerrequestfactory.py test_registerservertype.py 
Log Message:
Copied utility function here since the place it was imported from no
longer exists.


=== Zope3/src/zope/app/process/tests/test_registerrequestfactory.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/process/tests/test_registerrequestfactory.py:1.2	Wed Jun 25 11:29:33 2003
+++ Zope3/src/zope/app/process/tests/test_registerrequestfactory.py	Mon Jul 28 18:21:41 2003
@@ -18,11 +18,11 @@
 
 import unittest
 from zope.configuration.xmlconfig import xmlconfig
-from zope.configuration.tests.basetestdirectivesxml import makeconfig
 from zope.app.process.requestfactoryregistry import getRequestFactory
 from zope.testing.cleanup import CleanUp
 from zope.app.interfaces.startup import IPublicationRequestFactoryFactory
 from zope.interface import implements
+from cStringIO import StringIO
 
 class TF:
     "test request factory"
@@ -30,6 +30,22 @@
 
 tf = TF()
 
+ns = 'http://www.zope.org/NS/Zope3/test'
+
+def makeconfig(metadirectives,directives):
+    return StringIO(
+        '''<zopeConfigure
+               xmlns="http://namespaces.zope.org/zope"
+               xmlns:test="%(ns)s">
+            <directives namespace="%(ns)s">
+              %(metadirectives)s
+            </directives>
+            %(directives)s
+            </zopeConfigure>''' % {
+                'metadirectives': metadirectives,
+                'directives': directives,
+                'ns': ns})
+
 class Test(CleanUp, unittest.TestCase):
 
     def testRegisterRequestFactory(self):
@@ -66,7 +82,7 @@
         xmlconfig(makeconfig(
             '''<directive
                    name="registerRequestFactory"
-                   attributes="name publication request"
+                   attributes="name publication request factory"
                    handler=
                    "zope.app.process.metaconfigure.registerRequestFactory"
                    />''',


=== Zope3/src/zope/app/process/tests/test_registerservertype.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/process/tests/test_registerservertype.py:1.2	Wed Jun 25 11:29:33 2003
+++ Zope3/src/zope/app/process/tests/test_registerservertype.py	Mon Jul 28 18:21:41 2003
@@ -16,9 +16,24 @@
 
 import unittest
 from zope.configuration.xmlconfig import xmlconfig
-from zope.configuration.tests.basetestdirectivesxml import makeconfig
 from zope.app.process.servertyperegistry import getServerType
+from cStringIO import StringIO
 
+ns = 'http://www.zope.org/NS/Zope3/test'
+
+def makeconfig(metadirectives,directives):
+    return StringIO(
+        '''<zopeConfigure
+               xmlns="http://namespaces.zope.org/zope"
+               xmlns:test="%(ns)s">
+            <directives namespace="%(ns)s">
+              %(metadirectives)s
+            </directives>
+            %(directives)s
+            </zopeConfigure>''' % {
+                'metadirectives': metadirectives,
+                'directives': directives,
+                'ns': ns})
 
 class Test(unittest.TestCase):
 
@@ -26,7 +41,8 @@
         xmlconfig(makeconfig(
             '''<directive
                    name="registerServerType"
-                   attributes="name publication request"
+                   attributes="name publication request factory requestFactory
+                               defaultPort logFactory defaultVerbose"
                    handler="zope.app.process.metaconfigure.registerServerType"
                    />''',
             '''<test:registerServerType