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

15 lines
440 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):
testclient.app.config["LDAP"]["URI"] = "ldap://invalid-ldap.com"
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