forked from Github-Mirrors/canaille
fix: check command when SMTP configuration is not defined
This commit is contained in:
parent
98e5849a65
commit
b16630063b
2 changed files with 9 additions and 1 deletions
|
@ -163,7 +163,8 @@ def validate(config, validate_remote=False):
|
||||||
from canaille.backends import Backend
|
from canaille.backends import Backend
|
||||||
|
|
||||||
Backend.instance.validate(config)
|
Backend.instance.validate(config)
|
||||||
validate_smtp_configuration(config["CANAILLE"]["SMTP"])
|
if smtp_config := config["CANAILLE"]["SMTP"]:
|
||||||
|
validate_smtp_configuration(smtp_config)
|
||||||
|
|
||||||
|
|
||||||
def validate_keypair(config):
|
def validate_keypair(config):
|
||||||
|
|
|
@ -12,3 +12,10 @@ def test_check_command_fail(testclient):
|
||||||
runner = testclient.app.test_cli_runner()
|
runner = testclient.app.test_cli_runner()
|
||||||
res = runner.invoke(cli, ["check"])
|
res = runner.invoke(cli, ["check"])
|
||||||
assert res.exit_code == 1, res.stdout
|
assert res.exit_code == 1, res.stdout
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_command_no_smtp(testclient):
|
||||||
|
testclient.app.config["CANAILLE"]["SMTP"] = None
|
||||||
|
runner = testclient.app.test_cli_runner()
|
||||||
|
res = runner.invoke(cli, ["check"])
|
||||||
|
assert res.exit_code == 0, res.stdout
|
||||||
|
|
Loading…
Reference in a new issue