Skip to content

Commit

Permalink
added extra version callback test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Heffernan committed Feb 29, 2024
1 parent 68b38f1 commit b87db0e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/application/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ def test_that_version_callback_does_not_return_hook_versions_if_no_config(
assert "\nHook Versions:" not in result.stdout


@pytest.mark.parametrize("test_input", ["-v", "--version"])
def test_that_version_callback_returns_hook_versions_if_config(
test_input: str,
):
with patch.object(Path, "exists", return_value=True):
result = CliRunner().invoke(secureli.main.app, [test_input])

assert result.exit_code is 0
assert secureli_version() in result.stdout
assert "\nHook Versions:" in result.stdout
assert "--------------" in result.stdout


def test_that_app_ignores_version_callback(mock_container: MagicMock):
result = CliRunner().invoke(secureli.main.app, ["scan"])

Expand Down

0 comments on commit b87db0e

Please sign in to comment.