Skip to content

Commit

Permalink
Parameterized tests/functional/test_install_config.py::test_prompt_fo…
Browse files Browse the repository at this point in the history
…r_keyring_if_needed to add a few --no-input and --force-keyring scenarios
  • Loading branch information
Darsstar authored and Dos Moonen committed Dec 14, 2022
1 parent 9f3a988 commit c6d4e7e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions tests/functional/test_install_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,34 @@ def auth_needed(request: pytest.FixtureRequest) -> bool:

@pytest.fixture(
params=(
False,
True,
(False, False, False),
(False, True, False),
(True, True, False),
(True, False, True),
),
ids=(
"default-default",
"default-force_keyring",
"no_input-force_keyring",
"no_input-default",
),
ids=("default", "no_input"),
)
def flags(request: pytest.FixtureRequest) -> typing.List[str]:
no_input = request.param # type: ignore[attr-defined]
def flags(request: pytest.FixtureRequest, auth_needed: bool) -> typing.List[str]:
(
no_input,
force_keyring,
xfail,
) = request.param # type: ignore[attr-defined]

flags = []
if no_input:
flags.append("--no-input")

if force_keyring:
flags.append(
"--force-keyring",
)
if auth_needed and xfail:
request.applymarker(pytest.mark.xfail())
return flags

def test_prompt_for_keyring_if_needed(
Expand Down

0 comments on commit c6d4e7e

Please sign in to comment.