Beispiel #1
0
 def test_with_none(self, http, github, hdfs):
     with pytest.raises(TypeError):
         importable(None)
Beispiel #2
0
 def test_with_int(self, http, github, hdfs):
     with pytest.raises(TypeError):
         importable(123)
Beispiel #3
0
 def test_not_a_url(self, http, github, hdfs):
     with pytest.raises(ValueError):
         importable('Just some text.')
Beispiel #4
0
 def test_empty_str(self, http, github, hdfs):
     with pytest.raises(ValueError):
         importable('')
Beispiel #5
0
 def test_no_match_for_hdfs(self, http, github, hdfs):
     with pytest.raises(ValueError):
         importable('hdfs://localhost/dir/mymodule.zip')
Beispiel #6
0
 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
Beispiel #7
0
 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
Beispiel #8
0
 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
Beispiel #9
0
 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