1
0
mirror of https://github.com/enpaul/kodak.git synced 2025-12-17 16:30:37 +00:00

Fix typing errors

Fix missing dependencies in static tox envs
This commit is contained in:
2021-10-30 11:51:41 -04:00
parent 158db1209b
commit 19739d17f4
8 changed files with 37 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ from kodak import exceptions
@contextlib.contextmanager
def mockenv(patch, env: Dict[str, str]):
"""Simple context manager for patching in a bunch of env vars"""
for key, value in env.items():
patch.setenv(key, value)
yield
@@ -20,6 +21,8 @@ def mockenv(patch, env: Dict[str, str]):
def test_conf_global(monkeypatch):
"""Test the global config object and env parser"""
assert configuration.KodakConfig() == configuration.load()
with mockenv(
@@ -53,6 +56,8 @@ def test_conf_global(monkeypatch):
def test_conf_database(monkeypatch):
"""Test the database config object and env parser"""
with mockenv(monkeypatch, {"KODAK_DATABASE_BACKEND": "couchdb"}):
with pytest.raises(exceptions.ConfigurationError):
configuration.load()
@@ -94,6 +99,8 @@ def test_conf_database(monkeypatch):
def test_conf_manip(monkeypatch):
"""Test the manipulation config object and env parser"""
with mockenv(
monkeypatch,
{