コード例 #1
0
 def test_validate_remote_invalid_extension(self):
     uris = [
         "https://some_domain.com/path/file", "s3://bucket/file",
         "gs://bucket/file"
     ]
     with pytest.raises(ValueError,
                        match="Only .zip files supported for remote URIs."):
         parse_and_validate_py_modules(uris)
コード例 #2
0
 def test_validate_remote_valid_input(self):
     uris = [
         "https://some_domain.com/path/file.zip", "s3://bucket/file.zip",
         "gs://bucket/file.zip"
     ]
     py_modules = parse_and_validate_py_modules(uris)
     assert py_modules == uris
コード例 #3
0
 def test_validate_invalid_type(self):
     with pytest.raises(TypeError):
         parse_and_validate_py_modules([1])
コード例 #4
0
 def test_validate_bad_uri(self):
     with pytest.raises(ValueError, match="a valid URI"):
         parse_and_validate_py_modules(["unknown://abc"])
コード例 #5
0
 def test_validate_not_a_list(self):
     with pytest.raises(TypeError, match="must be a list of strings"):
         parse_and_validate_py_modules(".")
コード例 #6
0
 def test_validate_s3_valid_input(self):
     py_modules = parse_and_validate_py_modules(["s3://bucket/file.zip"])
     assert py_modules == ["s3://bucket/file.zip"]
コード例 #7
0
 def test_validate_s3_invalid_extension(self):
     with pytest.raises(
             ValueError, match="Only .zip files supported for S3 URIs."):
         parse_and_validate_py_modules(["s3://bucket/file"])