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 Apr 18, 2022
1 parent 0c4e786 commit f24cfb9
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 @@ -360,18 +360,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


Expand Down

0 comments on commit f24cfb9

Please sign in to comment.