def test_with_none(self, http, github, hdfs): with pytest.raises(TypeError): importable(None)
def test_with_int(self, http, github, hdfs): with pytest.raises(TypeError): importable(123)
def test_not_a_url(self, http, github, hdfs): with pytest.raises(ValueError): importable('Just some text.')
def test_empty_str(self, http, github, hdfs): with pytest.raises(ValueError): importable('')
def test_no_match_for_hdfs(self, http, github, hdfs): with pytest.raises(ValueError): importable('hdfs://localhost/dir/mymodule.zip')
def test_webhdfs_with_port(self, http, github, hdfs): importable('webhdfs://localhost:8080/dir/mymodule.zip') assert not github.called assert not http.called assert hdfs.called
def test_regular_https_with_port(self, http, github, hdfs): importable('http://localhost:8080/folder1/mymodule.zip') assert not github.called assert http.called assert not hdfs.called
def test_regular_https(self, http, github, hdfs): importable('https://www.somerepository.com/path/to/mymodule.zip') assert not github.called assert http.called assert not hdfs.called
def test_github_https(self, http, github, hdfs): importable('https://github.com/malexer/meteocalc/archive/master.zip') assert github.called assert not http.called assert not hdfs.called