commit | 03ff86da2543bbbad7753c930f8af7f2a783ad4d | [log] [tgz] |
---|---|---|
author | Skip Montanaro <skip@pobox.com> | Sun Mar 24 16:54:16 2002 +0000 |
committer | Skip Montanaro <skip@pobox.com> | Sun Mar 24 16:54:16 2002 +0000 |
tree | 2a7f7d697dd127fe075ead47e9d09489ef850831 | |
parent | 9d38997e8c4d06ec5717276590a3f1c6a88d2bb7 [diff] |
add test of InvalidURL
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 @@ 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"