[Zodb-checkins] CVS: StandaloneZConfig/ZConfig/tests -
test_datatypes.py:1.10
Fred L. Drake, Jr.
fred at zope.com
Thu Feb 5 11:40:30 EST 2004
Update of /cvs-repository/StandaloneZConfig/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv12716/ZConfig/tests
Modified Files:
test_datatypes.py
Log Message:
fix the default hostname for address datatypes for Windows
=== StandaloneZConfig/ZConfig/tests/test_datatypes.py 1.9 => 1.10 ===
--- StandaloneZConfig/ZConfig/tests/test_datatypes.py:1.9 Wed Dec 31 20:58:48 2003
+++ StandaloneZConfig/ZConfig/tests/test_datatypes.py Thu Feb 5 11:40:29 2004
@@ -164,9 +164,10 @@
def test_datatype_inet_address(self):
convert = self.types.get("inet-address")
eq = self.assertEqual
+ defhost = ZConfig.datatypes.DEFAULT_HOST
eq(convert("Host.Example.Com:80"), ("host.example.com", 80))
- eq(convert(":80"), ("", 80))
- eq(convert("80"), ("", 80))
+ eq(convert(":80"), (defhost, 80))
+ eq(convert("80"), (defhost, 80))
eq(convert("host.EXAMPLE.com"), ("host.example.com", None))
self.assertRaises(ValueError, convert, "40 # foo")
@@ -220,6 +221,7 @@
convert = self.types.get("socket-address")
eq = self.assertEqual
AF_INET = socket.AF_INET
+ defhost = ZConfig.datatypes.DEFAULT_HOST
def check(value, family, address, self=self, convert=convert):
a = convert(value)
@@ -227,8 +229,8 @@
self.assertEqual(a.address, address)
check("Host.Example.Com:80", AF_INET, ("host.example.com", 80))
- check(":80", AF_INET, ("", 80))
- check("80", AF_INET, ("", 80))
+ check(":80", AF_INET, (defhost, 80))
+ check("80", AF_INET, (defhost, 80))
check("host.EXAMPLE.com", AF_INET, ("host.example.com",None))
a1 = convert("/tmp/var/@345.4")
a2 = convert("/tmp/var/@345.4:80")
More information about the Zodb-checkins
mailing list