Add tests
This commit is contained in:
parent
d8794bb35e
commit
9912ead516
3 changed files with 12 additions and 3 deletions
|
@ -11,7 +11,6 @@ def setup_db():
|
||||||
database.setup(":memory:")
|
database.setup(":memory:")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_dao_published(setup_db):
|
def test_dao_published(setup_db):
|
||||||
|
|
||||||
# test count published
|
# test count published
|
||||||
|
@ -52,4 +51,3 @@ def test_dao_notified(setup_db):
|
||||||
dao.notify_comment(c3)
|
dao.notify_comment(c3)
|
||||||
assert 0 == len(dao.find_not_notified_comments())
|
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