diff options
-rw-r--r-- | moonv4/moon_utilities/tests/unit_python/conftest.py | 15 | ||||
-rw-r--r-- | moonv4/moon_utilities/tests/unit_python/test_cache.py | 3 |
2 files changed, 11 insertions, 7 deletions
diff --git a/moonv4/moon_utilities/tests/unit_python/conftest.py b/moonv4/moon_utilities/tests/unit_python/conftest.py index 177a406e..487c2f0e 100644 --- a/moonv4/moon_utilities/tests/unit_python/conftest.py +++ b/moonv4/moon_utilities/tests/unit_python/conftest.py @@ -125,17 +125,19 @@ COMPONENTS = ( "database", "slave", "components/manager", + "components/orchestrator", + "components/interface", ) def get_b64_conf(component=None): - if component in CONF: + if component == "components": + return base64.b64encode( + json.dumps(CONF["components"]).encode('utf-8')+b"\n").decode('utf-8') + elif component in CONF: return base64.b64encode( json.dumps( CONF[component]).encode('utf-8')+b"\n").decode('utf-8') - elif component == "components": - return base64.b64encode( - json.dumps(CONF["components"]).encode('utf-8')+b"\n").decode('utf-8') elif not component: return base64.b64encode( json.dumps(CONF).encode('utf-8')+b"\n").decode('utf-8') @@ -158,7 +160,10 @@ def no_requests(monkeypatch): ) m.register_uri( 'GET', 'http://consul:8500/v1/kv/components?recurse=true', - json=[{'Key': "components", 'Value': get_b64_conf("components")}] + json=[ + {"Key": key, "Value": get_b64_conf(key)} for key in COMPONENTS + ], + # json={'Key': "components", 'Value': get_b64_conf("components")} ) m.register_uri( 'POST', 'http://keystone:5000/v3/auth/tokens', diff --git a/moonv4/moon_utilities/tests/unit_python/test_cache.py b/moonv4/moon_utilities/tests/unit_python/test_cache.py index 5ecacfcf..15c5f22a 100644 --- a/moonv4/moon_utilities/tests/unit_python/test_cache.py +++ b/moonv4/moon_utilities/tests/unit_python/test_cache.py @@ -2,5 +2,4 @@ def test_cache(): from moon_utilities import cache c = cache.Cache() - r = c.authz_requests() - assert isinstance(r, dict) + assert isinstance(c.authz_requests, dict) |