diff --git a/tests/test_config.py b/tests/test_config.py index d0d8e75..db884c8 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -24,7 +24,7 @@ def test_get(init_config): assert config.get(ConfigParameter.HTTP_HOST) == "" assert config.get(ConfigParameter.HTTP_PORT) == str(EXPECTED_HTTP_PORT) assert config.get_int(ConfigParameter.HTTP_PORT) == EXPECTED_HTTP_PORT - with pytest.raises(AssertionError): + with pytest.raises(AssertionError): config.get_bool(ConfigParameter.DB_SQLITE_FILE) def test_put(init_config): diff --git a/tests/test_db.py b/tests/test_db.py index 1f390c3..649c5e7 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -11,7 +11,6 @@ def setup_db(): database.setup(":memory:") - def test_dao_published(setup_db): # test count published @@ -52,4 +51,3 @@ def test_dao_notified(setup_db): dao.notify_comment(c3) assert 0 == len(dao.find_not_notified_comments()) - diff --git a/tests/test_mail.py b/tests/test_mail.py new file mode 100644 index 0000000..192c3cc --- /dev/null +++ b/tests/test_mail.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import pytest +from stacosys.service import mailer + +def test_configure_and_check(): + mailer.configure_smtp("localhost", 2525, "admin", "admin") + mailer.configure_destination("admin@mydomain.com") + with pytest.raises(ConnectionRefusedError): + mailer.check() \ No newline at end of file