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

14 lines
441 B
Python

from canaille.commands import cli
def test_check_command(testclient):
runner = testclient.app.test_cli_runner()
res = runner.invoke(cli, ["check"])
assert res.exit_code == 0, res.stdout
def test_check_command_fail(testclient):
testclient.app.config["SMTP"]["HOST"] = "ldap://invalid-ldap.com"
runner = testclient.app.test_cli_runner()
res = runner.invoke(cli, ["check"])
assert res.exit_code == 1, res.stdout