Skip to content

Commit

Permalink
Better test error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbv committed Aug 4, 2023
1 parent afcc177 commit b8fa005
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/unit/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ def test_local_csp_usage_logging_not_set(caplog):
return_value=Path('csp_config.json')
):
_set_logger_file()
debug_message = "DEBUG CSPBillingAdapter:plugin.py:53 Logger " \
"file not set: [Errno 2] No such file or directory: " \
debug_message = "No such file or directory: " \
"'foo/bar/csp-config.json'"
assert 'Logger file not set' in caplog.text
assert debug_message in caplog.text


Expand All @@ -321,6 +321,5 @@ def test_local_csp_usage_logging_set(caplog):
content = f.read()
with patch('builtins.open', mock_open(read_data=content)):
_set_logger_file()
debug_message = "DEBUG CSPBillingAdapter:plugin.py:51 Logger " \
"file set"
debug_message = "Logger file set"
assert debug_message in caplog.text

0 comments on commit b8fa005

Please sign in to comment.