summaryrefslogtreecommitdiff
path: root/tests/test_set_config.py
diff options
context:
space:
mode:
authorAngus Salkeld <asalkeld@mirantis.com>2015-11-10 13:10:11 +1000
committerMichal Rostecki <mrostecki@mirantis.com>2015-11-17 07:51:32 +0000
commit2f1c00a467e381b690b8fd38a5c3b003f2da7ecf (patch)
treee70adf7d793dfc1333e8e24911c2812668e7599e /tests/test_set_config.py
parentdf0ef8ddb504fef0eddffd09127e1bb98a3fca88 (diff)
downloadkolla-2f1c00a467e381b690b8fd38a5c3b003f2da7ecf.tar.gz
kolla-2f1c00a467e381b690b8fd38a5c3b003f2da7ecf.zip
Add support for loading kolla config from ENV
Implements: blueprint zookeeper Change-Id: Ibabcb5d6d304be9290633338c513f16651d4479a
Diffstat (limited to 'tests/test_set_config.py')
-rw-r--r--tests/test_set_config.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_set_config.py b/tests/test_set_config.py
index c1e7f7927..1e8ac9ce6 100644
--- a/tests/test_set_config.py
+++ b/tests/test_set_config.py
@@ -45,3 +45,20 @@ class LoadFromFile(base.BaseTestCase):
mock.call().__enter__(),
mock.call().write(u'/bin/true'),
mock.call().__exit__(None, None, None)], mo.mock_calls)
+
+
+class LoadFromEnv(base.BaseTestCase):
+
+ def test_load_ok(self):
+ in_config = json.dumps({'command': '/bin/true',
+ 'config_files': {}})
+
+ mo = mock.mock_open()
+ with mock.patch.object(set_configs, 'open', mo):
+ with mock.patch.dict('os.environ', {'KOLLA_CONFIG': in_config}):
+ set_configs.load_config()
+ self.assertEqual([mock.call('/run_command', 'w+'),
+ mock.call().__enter__(),
+ mock.call().write(u'/bin/true'),
+ mock.call().__exit__(None, None, None)],
+ mo.mock_calls)