From 69c59a9f8bc4605e6e099a97c298bdfe06f1fdef Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Tue, 29 Dec 2015 10:38:52 +0530 Subject: [PATCH] Add env config test --- tests/test_plugin/test_plugin.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_plugin/test_plugin.py b/tests/test_plugin/test_plugin.py index 9cb19be..3033d2d 100644 --- a/tests/test_plugin/test_plugin.py +++ b/tests/test_plugin/test_plugin.py @@ -107,3 +107,20 @@ def test_intermediate_1(tmpdir): pytest_ret_code = popen_pytest.wait() 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")