[Zope-Checkins] CVS: Zope/lib/python/ZServer/tests - test_config.py:1.1.2.3
Fred L. Drake, Jr.
fred@zope.com
Thu, 27 Feb 2003 15:11:44 -0500
Update of /cvs-repository/Zope/lib/python/ZServer/tests
In directory cvs.zope.org:/tmp/cvs-serv8883
Modified Files:
Tag: new-install-branch
test_config.py
Log Message:
- move common checks for AF_UNIX addresses to load_unix_domain_factory()
- exercise .create() for all factories with AF_INET addresses
=== Zope/lib/python/ZServer/tests/test_config.py 1.1.2.2 => 1.1.2.3 ===
--- Zope/lib/python/ZServer/tests/test_config.py:1.1.2.2 Thu Feb 27 14:15:56 2003
+++ Zope/lib/python/ZServer/tests/test_config.py Thu Feb 27 15:11:39 2003
@@ -52,6 +52,8 @@
factory = self.load_factory(text % fn)
finally:
os.unlink(fn)
+ self.assert_(factory.host is None)
+ self.assert_(factory.port is None)
self.assertEqual(factory.path, fn)
return factory
@@ -68,9 +70,15 @@
""")
self.assert_(isinstance(factory,
ZServer.datatypes.HTTPServerFactory))
+ self.assert_(factory.force_connection_close)
self.assertEqual(factory.host, '')
self.assertEqual(factory.port, 81)
+ self.assertEqual(factory.webdav_source_clients, "cadaever")
self.check_prepare(factory)
+ server = factory.create()
+ self.assertEqual(server.ip, '127.0.0.1')
+ self.assertEqual(server.port, 9381)
+ server.close()
def test_webdav_source_factory(self):
factory = self.load_factory("""\
@@ -81,9 +89,14 @@
""")
self.assert_(isinstance(factory,
ZServer.datatypes.WebDAVSourceServerFactory))
+ self.assert_(factory.force_connection_close)
self.assertEqual(factory.host, '')
self.assertEqual(factory.port, 82)
self.check_prepare(factory)
+ server = factory.create()
+ self.assertEqual(server.ip, '127.0.0.1')
+ self.assertEqual(server.port, 9382)
+ server.close()
def test_pcgi_factory(self):
factory = self.load_unix_domain_factory("""\
@@ -93,8 +106,6 @@
""")
self.assert_(isinstance(factory,
ZServer.datatypes.PCGIServerFactory))
- self.assertEqual(factory.host, None)
- self.assertEqual(factory.port, None)
def test_fcgi_factory(self):
factory = self.load_factory("""\
@@ -108,6 +119,7 @@
self.assertEqual(factory.port, 83)
self.assertEqual(factory.path, None)
self.check_prepare(factory)
+ factory.create().close()
factory = self.load_unix_domain_factory("""\
<fcgi-server>
address %s
@@ -115,8 +127,6 @@
""")
self.assert_(isinstance(factory,
ZServer.datatypes.FCGIServerFactory))
- self.assertEqual(factory.host, None)
- self.assertEqual(factory.port, None)
self.check_prepare(factory)
def test_ftp_factory(self):
@@ -130,6 +140,7 @@
self.assertEqual(factory.host, '')
self.assertEqual(factory.port, 84)
self.check_prepare(factory)
+ factory.create().close()
def test_monitor_factory(self):
factory = self.load_factory("""\
@@ -142,6 +153,7 @@
self.assertEqual(factory.host, '')
self.assertEqual(factory.port, 85)
self.check_prepare(factory)
+ factory.create().close()
def test_icp_factory(self):
factory = self.load_factory("""\
@@ -154,6 +166,7 @@
self.assertEqual(factory.host, '')
self.assertEqual(factory.port, 86)
self.check_prepare(factory)
+ factory.create().close()
def check_prepare(self, factory):
port = factory.port