Skip to content

Commit 38292c4

Browse files
committed
Add tests for dockerfile paths to ensure backwards compatibility
1 parent 96d0461 commit 38292c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_parser.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,3 +1517,13 @@ def test_alt_dockerfile_names(self, tmpdir):
15171517

15181518
validate = DockerfileParser(path=tmpdir, dockerfile_filename="Containerfile")
15191519
assert validate.baseimage == out.baseimage
1520+
1521+
def test_dockerfile_path_compatibility(self, tmpdir):
1522+
parser = DockerfileParser(path=tmpdir)
1523+
assert str(parser.dockerfile) == parser.dockerfile_path
1524+
assert parser.dockerfile == tmpdir / "Dockerfile"
1525+
1526+
with (tmpdir / "nothing").open("w+") as testfile:
1527+
nullparser = DockerfileParser(fileobj=testfile)
1528+
assert nullparser.dockerfile is None
1529+
assert nullparser.dockerfile_path is None

0 commit comments

Comments
 (0)