Commit 86102785 authored by Tim Peters's avatar Tim Peters

BaseTest.check_prepare(): the default hostname on Windows isn't an

empty string, so check_prepare() can't expect factory.prepare() to
change the host on Windows.  This repairs Windows failures in

test_fcgi_factory
test_ftp_factory
test_http_factory
test_icp_factory
test_webdav_source_factory
test_monitor_factory_with_emergency_user
test_monitor_factory_without_emergency_user

Unfortunately, it also exposes 2 new Windows failures in

test_http_factory
test_webdav_source_factory
parent f4a5b0c1
......@@ -57,6 +57,10 @@ class BaseTest(unittest.TestCase):
return conf.servers[0]
def check_prepare(self, factory):
# On Linux the default hostname is an empty string, but on Windows
# it's "localhost". So factory.prepare() will replace factory.host
# with "127.0.0.1" only on non-Windows boxes.
expected_factory_host = factory.host or "127.0.0.1"
port = factory.port
o = object()
factory.prepare("127.0.0.1", o, "module",
......@@ -68,7 +72,7 @@ class BaseTest(unittest.TestCase):
self.assert_(factory.host is None)
self.assert_(factory.port is None)
else:
self.assertEqual(factory.host, "127.0.0.1")
self.assertEqual(factory.host, expected_factory_host)
self.assertEqual(factory.port, 9300 + port)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment