canaille-globuzma/tests/app/commands/test_check.py

15 lines
436 B
Python
Raw Normal View History

from canaille.commands import cli
2021-11-08 17:12:51 +00:00
def test_check_command(testclient):
runner = testclient.app.test_cli_runner()
2023-04-09 13:47:14 +00:00
res = runner.invoke(cli, ["check"])
assert res.exit_code == 0, res.stdout
2021-11-08 17:12:51 +00:00
def test_check_command_fail(testclient):
2023-06-03 21:38:45 +00:00
testclient.app.config["SMTP"]["HOST"] = "invalid-domain.com"
2021-11-08 17:12:51 +00:00
runner = testclient.app.test_cli_runner()
2023-04-09 13:47:14 +00:00
res = runner.invoke(cli, ["check"])
assert res.exit_code == 1, res.stdout