upgrade libs and follow linter recommandations
This commit is contained in:
parent
d6f7cdabfe
commit
7070e2a273
18 changed files with 321 additions and 283 deletions
|
|
@ -4,7 +4,7 @@
|
|||
import pytest
|
||||
from stacosys.conf.config import Config, ConfigParameter
|
||||
|
||||
EXPECTED_DB_URL = "sqlite:///db.sqlite"
|
||||
EXPECTED_DB_SQLITE_FILE = "db.sqlite"
|
||||
EXPECTED_HTTP_PORT = 8080
|
||||
EXPECTED_IMAP_PORT = "5000"
|
||||
EXPECTED_IMAP_LOGIN = "user"
|
||||
|
|
@ -13,7 +13,7 @@ EXPECTED_IMAP_LOGIN = "user"
|
|||
@pytest.fixture
|
||||
def conf():
|
||||
conf = Config()
|
||||
conf.put(ConfigParameter.DB_URL, EXPECTED_DB_URL)
|
||||
conf.put(ConfigParameter.DB_SQLITE_FILE, EXPECTED_DB_SQLITE_FILE)
|
||||
conf.put(ConfigParameter.HTTP_PORT, EXPECTED_HTTP_PORT)
|
||||
conf.put(ConfigParameter.IMAP_PORT, EXPECTED_IMAP_PORT)
|
||||
conf.put(ConfigParameter.SMTP_STARTTLS, "yes")
|
||||
|
|
@ -23,13 +23,13 @@ def conf():
|
|||
|
||||
def test_exists(conf):
|
||||
assert conf is not None
|
||||
assert conf.exists(ConfigParameter.DB_URL)
|
||||
assert conf.exists(ConfigParameter.DB_SQLITE_FILE)
|
||||
assert not conf.exists(ConfigParameter.IMAP_HOST)
|
||||
|
||||
|
||||
def test_get(conf):
|
||||
assert conf is not None
|
||||
assert conf.get(ConfigParameter.DB_URL) == EXPECTED_DB_URL
|
||||
assert conf.get(ConfigParameter.DB_SQLITE_FILE) == EXPECTED_DB_SQLITE_FILE
|
||||
assert conf.get(ConfigParameter.HTTP_PORT) == EXPECTED_HTTP_PORT
|
||||
assert conf.get(ConfigParameter.HTTP_HOST) is None
|
||||
assert conf.get(ConfigParameter.HTTP_PORT) == EXPECTED_HTTP_PORT
|
||||
|
|
@ -38,14 +38,14 @@ def test_get(conf):
|
|||
try:
|
||||
conf.get_int(ConfigParameter.HTTP_PORT)
|
||||
assert False
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
assert conf.get_bool(ConfigParameter.SMTP_STARTTLS)
|
||||
assert not conf.get_bool(ConfigParameter.IMAP_SSL)
|
||||
try:
|
||||
conf.get_bool(ConfigParameter.DB_URL)
|
||||
assert False
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from stacosys import __version__
|
|||
|
||||
|
||||
def test_version():
|
||||
assert __version__ == '2.0'
|
||||
assert __version__ == "2.0"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# -*- coding: UTF-8 -*-
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
from stacosys.core.templater import Templater, Template
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue