Пример #1
0
 def test_validate_dockerfile_path_is_dockerfile(self,
                                                 tmp_path: Path) -> None:
     """Test _validate_dockerfile does not exist."""
     path = tmp_path / "Dockerfile"
     path.touch()
     with pytest.raises(ValueError) as excinfo:
         ImageBuildArgs._validate_dockerfile(path, "./Dockerfile")
     assert str(excinfo.value).startswith(
         "ImageBuildArgs.path should not reference the Dockerfile directly")
Пример #2
0
 def test_validate_dockerfile_path_is_zipfile(self, tmp_path):
     # type: (Path) -> None
     """Test _validate_dockerfile path is zipfile."""
     path = tmp_path / "something.zip"
     path.touch()
     assert (
         ImageBuildArgs._validate_dockerfile(path, "./Dockerfile") == "./Dockerfile"
     )
Пример #3
0
 def test_validate_dockerfile(self, tmp_path):
     # type: (Path) -> None
     """Test _validate_dockerfile."""
     (tmp_path / "Dockerfile").touch()
     assert (
         ImageBuildArgs._validate_dockerfile(tmp_path, "./Dockerfile")
         == "./Dockerfile"
     )
Пример #4
0
 def test_validate_dockerfile_does_not_exist(self, tmp_path):
     # type: (Path) -> None
     """Test _validate_dockerfile does not exist."""
     with pytest.raises(ValueError) as excinfo:
         ImageBuildArgs._validate_dockerfile(tmp_path, "./Dockerfile")
     assert str(excinfo.value).startswith("Dockerfile does not exist at path")