From: Skip Montanaro Date: Sun, 24 Mar 2002 16:54:16 +0000 (+0000) Subject: add test of InvalidURL X-Git-Tag: v2.3c1~6362 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03ff86da2543bbbad7753c930f8af7f2a783ad4d;p=python add test of InvalidURL --- diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index d39e85f415..7860dd3138 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"