Browse Source

fixed failing unit test

pull/342/head
Chris Caron 4 years ago
parent
commit
5e002044a4
  1. 33
      test/test_cli.py

33
test/test_cli.py

@ -431,13 +431,15 @@ def test_apprise_cli_nux_env(tmpdir):
]) ])
assert result.exit_code == 0 assert result.exit_code == 0
with environ(APPRISE_URLS=" "): with mock.patch('apprise.cli.DEFAULT_SEARCH_PATHS', []):
# An empty string is not valid and therefore not loaded with environ(APPRISE_URLS=" "):
# so the below fails # An empty string is not valid and therefore not loaded so the below
result = runner.invoke(cli.main, [ # fails. We override the DEFAULT_SEARCH_PATHS because we don't
'-b', 'test environment', # want to detect ones loaded on the machine running the unit tests
]) result = runner.invoke(cli.main, [
assert result.exit_code == 3 '-b', 'test environment',
])
assert result.exit_code == 1
with environ(APPRISE_URLS="bad://localhost"): with environ(APPRISE_URLS="bad://localhost"):
result = runner.invoke(cli.main, [ result = runner.invoke(cli.main, [
@ -471,13 +473,16 @@ def test_apprise_cli_nux_env(tmpdir):
]) ])
assert result.exit_code == 0 assert result.exit_code == 0
with environ(APPRISE_CONFIG=" "): with mock.patch('apprise.cli.DEFAULT_SEARCH_PATHS', []):
# We will fail to send the notification as no path was with environ(APPRISE_CONFIG=" "):
# specified # We will fail to send the notification as no path was
result = runner.invoke(cli.main, [ # specified.
'-b', 'my message', # We override the DEFAULT_SEARCH_PATHS because we don't
]) # want to detect ones loaded on the machine running the unit tests
assert result.exit_code == 3 result = runner.invoke(cli.main, [
'-b', 'my message',
])
assert result.exit_code == 1
with environ(APPRISE_CONFIG="garbage/file/path.yaml"): with environ(APPRISE_CONFIG="garbage/file/path.yaml"):
# We will fail to send the notification as the path # We will fail to send the notification as the path

Loading…
Cancel
Save