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