コード例 #1
0
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 def test_with_none(self, http, github, hdfs):
     with pytest.raises(TypeError):
         importable(None)
コード例 #2
0
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 def test_with_int(self, http, github, hdfs):
     with pytest.raises(TypeError):
         importable(123)
コード例 #3
0
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 def test_not_a_url(self, http, github, hdfs):
     with pytest.raises(ValueError):
         importable('Just some text.')
コード例 #4
0
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 def test_empty_str(self, http, github, hdfs):
     with pytest.raises(ValueError):
         importable('')
コード例 #5
0
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 def test_no_match_for_hdfs(self, http, github, hdfs):
     with pytest.raises(ValueError):
         importable('hdfs://localhost/dir/mymodule.zip')
コード例 #6
0
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 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
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 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
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 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
ファイル: test_url_parsing.py プロジェクト: xenuts/importable
 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