Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for pipx (jsc#PED-5573) #372

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bci_tester/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ def create_BCI(
PYTHON311_CONTAINER,
]

PYTHON_WITH_PIPX_CONTAINERS = [
PYTHON310_CONTAINER,
PYTHON311_CONTAINER,
]

RUBY_25_CONTAINER = create_BCI(
build_tag="bci/ruby:2.5", available_versions=["15.5"]
)
Expand Down
22 changes: 22 additions & 0 deletions tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from bci_tester.data import OS_VERSION
from bci_tester.data import PYTHON_CONTAINERS
from bci_tester.data import PYTHON_WITH_PIPX_CONTAINERS
from bci_tester.runtime_choice import PODMAN_SELECTED

bcdir = "/tmp/"
Expand Down Expand Up @@ -87,6 +88,27 @@ def test_python_version(auto_container):
assert reported_version == f"Python {version_from_env}"


@pytest.mark.parametrize(
"container_per_test",
PYTHON_WITH_PIPX_CONTAINERS,
indirect=["container_per_test"],
)
def test_pipx(container_per_test):
"""Test that we can install xkcdpass via :command:`pipx`."""
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
Loading