Skip to content

Commit

Permalink
assert warnmsg occurs in _get_rpm_name function
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfratrik committed Apr 2, 2024
1 parent e9ce053 commit 697452a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def mocked_run(cmd, *args, **kwargs):
monkeypatch.setattr(api, 'current_logger', testutils.logger_mocked())
assert scansourcefiles._get_rpm_name(input_file) == run_output['stdout'][0]

if len(run_output['stdout']) > 1:
expected_warnmsg = ('The {} file is owned by multiple rpms: {}.'
.format(input_file, ', '.join(run_output['stdout'])))
assert api.current_logger.warnmsg == [expected_warnmsg]


def test_get_rpm_name_error(monkeypatch):
input_file = '/file'
Expand Down

0 comments on commit 697452a

Please sign in to comment.