[Zope-Checkins] CVS: Zope3/lib/python/Zope/StartUp/tests - testRegisterServerType.py:1.1.2.3

Shane Hathaway shane@cvs.zope.org
Fri, 12 Apr 2002 17:31:06 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/StartUp/tests
In directory cvs.zope.org:/tmp/cvs-serv20835/lib/python/Zope/StartUp/tests

Modified Files:
      Tag: Zope-3x-branch
	testRegisterServerType.py 
Log Message:
Merged Zope3-Server-Branch.


=== Zope3/lib/python/Zope/StartUp/tests/testRegisterServerType.py 1.1.2.2 => 1.1.2.3 ===
 # 
 ##############################################################################
-"""
-
-$Id$
-"""
-
-import unittest
-from Zope.StartUp.ServerTypeRegistry import getServerType
-
-from Zope.Configuration.xmlconfig import xmlconfig
-from cStringIO import StringIO
-
-
-template = """<zopeConfigure
-   xmlns='http://namespaces.zope.org/zope'
-   xmlns:startup='http://namespaces.zope.org/startup'>
-   %s
-   </zopeConfigure>"""
-
-
-class Test( unittest.TestCase ):
-
-
-    def testRegisterServerType(self):
-
-        xmlconfig(StringIO(template % (
-            '''<directive name="registerServerType"
-                 attributes="name, publication, request"
-                 handler="Zope.StartUp.metaConfigure.registerServerType"
-                 namespace="http://namespaces.zope.org/startup" />
-
-               <startup:registerServerType 
-                 name = "Browser"
-                 factory = "Zope.Server.PublisherServers.PublisherHTTPServer"
-                 requestFactory="BrowserRequestFactory"
-                 logFactory = "Zope.Server.HTTPServer.CommonHitLogger"
-                 defaultPort="8080"
-                 defaultVerbose="true" />
-            '''
-            )))
-
-        from Zope.Server.PublisherServers import PublisherHTTPServer
-        from Zope.Server.HTTPServer import CommonHitLogger
-
-        self.assertEqual(getServerType('Browser')._factory,
-                         PublisherHTTPServer)
-        self.assertEqual(getServerType('Browser')._logFactory, CommonHitLogger)
-        self.assertEqual(getServerType('Browser')._requestFactory,
-                         "BrowserRequestFactory")
-        self.assertEqual(getServerType('Browser')._defaultPort, 8080)
-        self.assertEqual(getServerType('Browser')._defaultVerbose, 1)
-
-
-
-def test_suite():
-    loader = unittest.TestLoader()
-    return loader.loadTestsFromTestCase( Test )
-
-
-if __name__=='__main__':
-    unittest.TextTestRunner().run( test_suite() )
-
+"""terServerType.py,v 1.1.2.2 2002/04/02 02:20:40 srichter Exp $
+"""
+
+import unittest
+from Zope.StartUp.ServerTypeRegistry import getServerType
+
+from Zope.Configuration.xmlconfig import xmlconfig
+from cStringIO import StringIO
+
+
+template = """<zopeConfigure
+   xmlns='http://namespaces.zope.org/zope'
+   xmlns:startup='http://namespaces.zope.org/startup'>
+   %s
+   </zopeConfigure>"""
+
+
+class Test( unittest.TestCase ):
+
+
+    def testRegisterServerType(self):
+
+        xmlconfig(StringIO(template % (
+            '''<directive name="registerServerType"
+                 attributes="name, publication, request"
+                 handler="Zope.StartUp.metaConfigure.registerServerType"
+                 namespace="http://namespaces.zope.org/startup" />
+
+               <startup:registerServerType 
+                 name = "Browser"
+                 factory = "Zope.Server.HTTP.PublisherHTTPServer."
+                 requestFactory="BrowserRequestFactory"
+                 logFactory = "Zope.Server.HTTP.CommonHitLogger."
+                 defaultPort="8080"
+                 defaultVerbose="true" />
+            '''
+            )))
+
+        from Zope.Server.HTTP.PublisherHTTPServer import PublisherHTTPServer
+        from Zope.Server.HTTP.CommonHitLogger import CommonHitLogger
+
+        self.assertEqual(getServerType('Browser')._factory,
+                         PublisherHTTPServer)
+        self.assertEqual(getServerType('Browser')._logFactory, CommonHitLogger)
+        self.assertEqual(getServerType('Browser')._requestFactory,
+                         "BrowserRequestFactory")
+        self.assertEqual(getServerType('Browser')._defaultPort, 8080)
+        self.assertEqual(getServerType('Browser')._defaultVerbose, 1)
+
+
+
+def test_suite():
+    loader = unittest.TestLoader()
+    return loader.loadTestsFromTestCase( Test )
+
+
+if __name__=='__main__':
+    unittest.TextTestRunner().run( test_suite() )
+