diff --git a/MuEnvironment/WebDependency.py b/MuEnvironment/WebDependency.py index 40f3e2c..360208d 100644 --- a/MuEnvironment/WebDependency.py +++ b/MuEnvironment/WebDependency.py @@ -29,7 +29,8 @@ import shutil import tarfile import zipfile -import urllib +import urllib.error +import urllib.request from MuEnvironment.ExternalDependency import ExternalDependency diff --git a/MuEnvironment/tests/test_WebDependency.py b/MuEnvironment/tests/test_WebDependency.py index 42f1242..e333dc5 100644 --- a/MuEnvironment/tests/test_WebDependency.py +++ b/MuEnvironment/tests/test_WebDependency.py @@ -32,6 +32,7 @@ import tarfile import zipfile import tempfile +import urllib.request from MuEnvironment import EnvironmentDescriptorFiles as EDF from MuEnvironment.WebDependency import WebDependency @@ -94,7 +95,7 @@ def test_fail_with_bad_url(self): ext_dep_descriptor = EDF.ExternDepDescriptor(ext_dep_file_path).descriptor_contents ext_dep = WebDependency(ext_dep_descriptor) - with self.assertRaises(Exception): + with self.assertRaises(urllib.error.HTTPError): ext_dep.fetch() self.fail("should have thrown an Exception")