Skip to content

Commit

Permalink
[tests] DRY copied filename
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak committed Jan 10, 2025
1 parent 384ac21 commit 1250587
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_copy_from_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)

0 comments on commit 1250587

Please sign in to comment.