[Zope3-checkins] CVS: Zope3/src/zope/app/startup/tests - test_registerrequestfactory.py:1.2.4.1

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:42:03 -0500


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

Modified Files:
      Tag: paris-copypasterename-branch
	test_registerrequestfactory.py 
Log Message:
Updating from HEAD to make sure everything still works before merging

=== Zope3/src/zope/app/startup/tests/test_registerrequestfactory.py 1.2 => 1.2.4.1 ===
--- Zope3/src/zope/app/startup/tests/test_registerrequestfactory.py:1.2	Wed Dec 25 09:13:25 2002
+++ Zope3/src/zope/app/startup/tests/test_registerrequestfactory.py	Tue Feb 11 09:41:32 2003
@@ -21,9 +21,16 @@
 from zope.configuration.xmlconfig import xmlconfig
 from zope.configuration.tests.basetestdirectivesxml import makeconfig
 from zope.app.startup.requestfactoryregistry import getRequestFactory
+from zope.testing.cleanup import CleanUp
+from zope.app.interfaces.startup import IPublicationRequestFactoryFactory
 
+class TF:
+    "test request factory"
+    __implements__ = IPublicationRequestFactoryFactory
 
-class Test( unittest.TestCase ):
+tf = TF()
+
+class Test(CleanUp, unittest.TestCase):
 
     def testRegisterRequestFactory(self):
 
@@ -52,6 +59,32 @@
         self.assertEqual(
             getRequestFactory('BrowserRequestFactory')._request,
             BrowserRequest)
+
+
+    def testRegisterRequestFactory_w_factory(self):
+
+        xmlconfig(makeconfig(
+            '''<directive
+                   name="registerRequestFactory"
+                   attributes="name publication request"
+                   handler=
+                   "zope.app.startup.metaconfigure.registerRequestFactory"
+                   />''',
+            '''<test:registerRequestFactory
+                   name="BrowserRequestFactory"
+                   factory="
+                   zope.app.startup.tests.test_registerrequestfactory.tf"
+                   />
+            '''
+            ))
+
+        import zope.app.startup.tests.test_registerrequestfactory
+
+        self.assertEqual(
+            getRequestFactory('BrowserRequestFactory'),
+            zope.app.startup.tests.test_registerrequestfactory.tf
+            )
+