Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03ff86d

Browse files
author
Skip Montanaro
committed
add test of InvalidURL
1 parent 9d38997 commit 03ff86d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_httplib.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ def makefile(self, mode, bufsize=None):
2929
print "BadStatusLine raised as expected"
3030
else:
3131
print "Expect BadStatusLine"
32+
33+
# Check invalid host_port
34+
35+
for hp in ("www.python.org:abc", "www.python.org:"):
36+
try:
37+
h = httplib.HTTP(hp)
38+
except httplib.InvalidURL:
39+
print "InvalidURL raised as expected"
40+
else:
41+
print "Expect InvalidURL"

0 commit comments

Comments
 (0)