diff --git a/tests/test_copy_from_repo.py b/tests/test_copy_from_repo.py index afc9af9..5e663c9 100644 --- a/tests/test_copy_from_repo.py +++ b/tests/test_copy_from_repo.py @@ -6,10 +6,12 @@ from .images import LEAP_URL +_FNAME = "pyproject.toml" + LEAP_WITH_CONFIG_FILE = DerivedContainer( base=LEAP_URL, - containerfile="""WORKDIR /opt/app/ -COPY pyproject.toml /opt/app/pyproject.toml""", + containerfile=f"""WORKDIR /opt/app/ +COPY {_FNAME} /opt/app/{_FNAME}""", ) CONTAINER_IMAGES = [LEAP_WITH_CONFIG_FILE] @@ -18,10 +20,8 @@ def test_config_file_present( auto_container: ContainerData, pytestconfig: Config ): - assert auto_container.connection.file("/opt/app/pyproject.toml").exists - with open( - pytestconfig.rootpath / "pyproject.toml", encoding="utf-8" - ) as pyproject: + assert auto_container.connection.file(f"/opt/app/{_FNAME}").exists + with open(pytestconfig.rootpath / _FNAME, encoding="utf-8") as pyproject: assert auto_container.connection.file( - "/opt/app/pyproject.toml" + f"/opt/app/{_FNAME}" ).content_string == pyproject.read(-1)