Skip to content

Commit

Permalink
Add test for pipx (jsc#PED-5573)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Jan 5, 2024
1 parent 07fb27a commit 9e38713
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,30 @@ def test_python_version(auto_container):
assert reported_version == f"Python {version_from_env}"


@pytest.mark.parametrize(
"container_per_test", CONTAINER_IMAGES_T2, indirect=["container_per_test"]
)
def test_pipx(container_per_test):
"""Test that we can install xkcdpass via :command:`pipx`."""

# the pipx situation on SLE 15 is a bit complicated
if not container_per_test.connection.exists("pipx"):
pytest.skip("pipx not available")

container_per_test.connection.check_output("pipx install xkcdpass")
assert "xkcdpass" in container_per_test.connection.check_output(
"pipx list --short"
)
run1 = container_per_test.connection.check_output("xkcdpass")
run2 = container_per_test.connection.check_output("xkcdpass")
assert (
len(run1) > 20 and len(run2) > 20
), "xkcdpass should output a passphrase with more than 20 characters"
assert (
run1 != run2
), "xkcdpass should output a different passphrase each time"


def test_pip(auto_container):
"""Check that :command:`pip` is installed and its version equals the value from
the environment variable ``PIP_VERSION``.
Expand Down

0 comments on commit 9e38713

Please sign in to comment.