Use $QUAYPATH and $QUAYDIR in conf and init files

This commit is contained in:
Antoine Legrand 2017-02-02 00:17:25 +01:00 committed by Antoine Legrand
parent 334a08d90b
commit cdb3722c17
59 changed files with 341 additions and 225 deletions

View file

@ -1,7 +1,8 @@
import pytest
import os
from util.log import logfile_path, filter_logs
from app import FILTERED_VALUES
from _init import CONF_DIR
def test_filter_logs():
values = {
@ -16,20 +17,20 @@ def test_filter_logs():
@pytest.mark.parametrize('debug,jsonfmt,expected', [
(False, False, "conf/logging.conf"),
(False, True, "conf/logging_json.conf"),
(True, False, "conf/logging_debug.conf"),
(True, True, "conf/logging_debug_json.conf"),
(False, False, os.path.join(CONF_DIR, "logging.conf")),
(False, True, os.path.join(CONF_DIR, "logging_json.conf")),
(True, False, os.path.join(CONF_DIR, "logging_debug.conf")),
(True, True, os.path.join(CONF_DIR, "logging_debug_json.conf"))
])
def test_logfile_path(debug, jsonfmt, expected, monkeypatch):
assert logfile_path(jsonfmt=jsonfmt, debug=debug) == expected
@pytest.mark.parametrize('debug,jsonfmt,expected', [
("false", "false", "conf/logging.conf"),
("false", "true", "conf/logging_json.conf"),
("true", "false", "conf/logging_debug.conf"),
("true", "true", "conf/logging_debug_json.conf"),
("false", "false", os.path.join(CONF_DIR, "logging.conf")),
("false", "true", os.path.join(CONF_DIR, "logging_json.conf")),
("true", "false", os.path.join(CONF_DIR, "logging_debug.conf")),
("true", "true", os.path.join(CONF_DIR, "logging_debug_json.conf"))
])
def test_logfile_path_env(debug, jsonfmt, expected, monkeypatch):
monkeypatch.setenv("DEBUGLOG", debug)
@ -38,4 +39,4 @@ def test_logfile_path_env(debug, jsonfmt, expected, monkeypatch):
def test_logfile_path_default():
assert logfile_path() == "conf/logging.conf"
assert logfile_path() == os.path.join(CONF_DIR, "logging.conf")