Commit 3cb3df32 authored by Jason R. Coombs's avatar Jason R. Coombs

Merge

--HG--
branch : distribute
extra : rebase_source : c4ea7aaf7256ffbb49843e9610515a08a76daa63
parents 0cb6b8be 6ee14089
...@@ -60,6 +60,9 @@ class TestPackageIndex(unittest.TestCase): ...@@ -60,6 +60,9 @@ class TestPackageIndex(unittest.TestCase):
urllib2.urlopen = old_urlopen urllib2.urlopen = old_urlopen
def test_bad_url_double_scheme(self): def test_bad_url_double_scheme(self):
"""
A bad URL with a double scheme should raise a DistutilsError.
"""
index = setuptools.package_index.PackageIndex( index = setuptools.package_index.PackageIndex(
hosts=('www.example.com',) hosts=('www.example.com',)
) )
...@@ -69,13 +72,9 @@ class TestPackageIndex(unittest.TestCase): ...@@ -69,13 +72,9 @@ class TestPackageIndex(unittest.TestCase):
try: try:
index.open_url(url) index.open_url(url)
except distutils.errors.DistutilsError, error: except distutils.errors.DistutilsError, error:
# Python 2.7.3 msg = unicode(error)
self.assertTrue('getaddrinfo failed' in str(error), "error was " + assert 'nonnumeric port' in msg or 'getaddrinfo failed' in msg
str(error)) raise RuntimeError("Did not raise")
except httplib.InvalidURL, error:
# Python 2.7.2 and earlier
self.assertTrue('nonnumeric port' in str(error), "error was " +
str(error))
def test_bad_url_screwy_href(self): def test_bad_url_screwy_href(self):
index = setuptools.package_index.PackageIndex( index = setuptools.package_index.PackageIndex(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment