Skip to content

Commit

Permalink
fixed failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Dec 31, 2020
1 parent ef2057c commit 5e00204
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,15 @@ def url(self, *args, **kwargs):
])
assert result.exit_code == 0

with environ(APPRISE_URLS=" "):
# An empty string is not valid and therefore not loaded
# so the below fails
result = runner.invoke(cli.main, [
'-b', 'test environment',
])
assert result.exit_code == 3
with mock.patch('apprise.cli.DEFAULT_SEARCH_PATHS', []):
with environ(APPRISE_URLS=" "):
# An empty string is not valid and therefore not loaded so the below
# fails. We override the DEFAULT_SEARCH_PATHS because we don't
# want to detect ones loaded on the machine running the unit tests
result = runner.invoke(cli.main, [
'-b', 'test environment',
])
assert result.exit_code == 1

with environ(APPRISE_URLS="bad://localhost"):
result = runner.invoke(cli.main, [
Expand Down Expand Up @@ -471,13 +473,16 @@ def url(self, *args, **kwargs):
])
assert result.exit_code == 0

with environ(APPRISE_CONFIG=" "):
# We will fail to send the notification as no path was
# specified
result = runner.invoke(cli.main, [
'-b', 'my message',
])
assert result.exit_code == 3
with mock.patch('apprise.cli.DEFAULT_SEARCH_PATHS', []):
with environ(APPRISE_CONFIG=" "):
# We will fail to send the notification as no path was
# specified.
# We override the DEFAULT_SEARCH_PATHS because we don't
# want to detect ones loaded on the machine running the unit tests
result = runner.invoke(cli.main, [
'-b', 'my message',
])
assert result.exit_code == 1

with environ(APPRISE_CONFIG="garbage/file/path.yaml"):
# We will fail to send the notification as the path
Expand Down

0 comments on commit 5e00204

Please sign in to comment.