Skip to content

Commit

Permalink
fix(test): Add GPG validation mock for test that requires it
Browse files Browse the repository at this point in the history
  • Loading branch information
m-horky committed Feb 29, 2024
1 parent 82d554d commit df42531
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: "Checkout the repository"
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: "Install dependencies"
# We can't run 'pip install' over the core repo, pip 20 doesn't understand the 'extras_require' in its setup.py
Expand Down
3 changes: 2 additions & 1 deletion src/insights_client/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def test_help_command(capsys):

assert output_sudo==output_normal

@patch("insights_client.gpg_validate", return_value = True)
@patch('insights_client.sys.argv', ['insights-client'])
def test_exit_when_run_phases_no_sudo():
def test_exit_when_run_phases_no_sudo(gpg_validate):
with raises(SystemExit) as pytest_wrapped_e:
with patch('os.getuid', return_value=1):
insights_client._main()
Expand Down

0 comments on commit df42531

Please sign in to comment.