summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index d39e85f..7860dd3 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -29,3 +29,13 @@ except httplib.BadStatusLine:
print "BadStatusLine raised as expected"
else:
print "Expect BadStatusLine"
+
+# Check invalid host_port
+
+for hp in ("www.python.org:abc", "www.python.org:"):
+ try:
+ h = httplib.HTTP(hp)
+ except httplib.InvalidURL:
+ print "InvalidURL raised as expected"
+ else:
+ print "Expect InvalidURL"