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