Add tests
This commit is contained in:
parent
d8794bb35e
commit
9912ead516
3 changed files with 12 additions and 3 deletions
|
@ -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):
|
||||
|
|
|
@ -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())
|
||||
|
||||
|
||||
|
|
11
tests/test_mail.py
Normal file
11
tests/test_mail.py
Normal file
|
@ -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()
|
Loading…
Add table
Reference in a new issue