Add env config test

This commit is contained in:
2015-12-29 10:38:52 +05:30
parent 275e34388d
commit 69c59a9f8b
+17
View File
@@ -107,3 +107,20 @@ def test_intermediate_1(tmpdir):
pytest_ret_code = popen_pytest.wait() pytest_ret_code = popen_pytest.wait()
assert pytest_ret_code == 0 assert pytest_ret_code == 0
@patch.dict("os.environ",
{"REDIS_PATH": "test_redis",
"REDIS_ARGS": "--test_arg = test_val",
"REDIS_PORT": "1234"})
def test_env_redis_1(monkeypatch):
# REDIS_PATH
# REDIS_ARGS
# REDIS_PORT
# del status_plugin
monkeypatch.setenv("REDIS_PATH", "test")
print("recalc")
status_plugin.calc_globals()
redis_cmd_final = status_plugin.command_redis_server
assert(redis_cmd_final == "test_redis --port 1234 --test_arg=test_val")