Fix unit tests

pull/18/head
Yax 8 months ago
parent a18eaf2237
commit 537e509027

@ -3,13 +3,14 @@
import pytest
from stacosys.service import config
from stacosys.service.configuration import Config
from stacosys.service.configuration import ConfigParameter
EXPECTED_DB = "sqlite://db.sqlite"
EXPECTED_HTTP_PORT = 8080
EXPECTED_LANG = "fr"
config = Config()
@pytest.fixture
def init_config():

@ -7,6 +7,9 @@ import pytest
from stacosys.db import database
from stacosys.interface import app, form
from stacosys.service.configuration import Config
from stacosys.service.mail import Mailer
from stacosys.service.rssfeed import Rss
@pytest.fixture
@ -14,6 +17,9 @@ def client():
logger = logging.getLogger(__name__)
database.configure("sqlite:memory://db.sqlite")
logger.info(f"start interface {form}")
app.config['CONFIG'] = Config()
app.config['MAILER'] = Mailer()
app.config['RSS'] = Rss()
return app.test_client()

@ -3,10 +3,11 @@
import pytest
from stacosys.service import mailer
from stacosys.service.mail import Mailer
def test_configure_and_check():
mailer = Mailer()
mailer.configure_smtp("localhost", 2525, "admin", "admin")
mailer.configure_destination("admin@mydomain.com")
with pytest.raises(ConnectionRefusedError):

@ -1,8 +1,9 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from stacosys.service import rss
from stacosys.service.rssfeed import Rss
def test_configure():
rss = Rss()
rss.configure("comments.xml", "blog", "http", "blog.mydomain.com")

Loading…
Cancel
Save