aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonutilities/tests/unit_python/mock_repo
diff options
context:
space:
mode:
authorRuan HE <ruan.he@orange.com>2018-01-03 15:12:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-03 15:12:09 +0000
commited403078a96170ca4dcb102d7357fefbe16b45c8 (patch)
tree2b50168ff4b817bd407aa82e9cd1e5ea624870c4 /python_moonutilities/tests/unit_python/mock_repo
parent0e678794fd2c858069fbbe0b985a0e2f064862b1 (diff)
parentc7b935cd626cb93876d72f6876eda1dd5c4d5be7 (diff)
Merge "adding more unit tests for configuration module"
Diffstat (limited to 'python_moonutilities/tests/unit_python/mock_repo')
-rw-r--r--python_moonutilities/tests/unit_python/mock_repo/components_utilities.py2
-rw-r--r--python_moonutilities/tests/unit_python/mock_repo/urls.py13
2 files changed, 15 insertions, 0 deletions
diff --git a/python_moonutilities/tests/unit_python/mock_repo/components_utilities.py b/python_moonutilities/tests/unit_python/mock_repo/components_utilities.py
index 1d79d890..53c51343 100644
--- a/python_moonutilities/tests/unit_python/mock_repo/components_utilities.py
+++ b/python_moonutilities/tests/unit_python/mock_repo/components_utilities.py
@@ -134,3 +134,5 @@ def get_b64_conf(component=None):
return base64.b64encode(
json.dumps(
CONF[key1][key2]).encode('utf-8')+b"\n").decode('utf-8')
+ else:
+ return base64.b64encode(component.encode('utf-8')+b"\n").decode('utf-8')
diff --git a/python_moonutilities/tests/unit_python/mock_repo/urls.py b/python_moonutilities/tests/unit_python/mock_repo/urls.py
index 75b55927..ff7976da 100644
--- a/python_moonutilities/tests/unit_python/mock_repo/urls.py
+++ b/python_moonutilities/tests/unit_python/mock_repo/urls.py
@@ -13,6 +13,19 @@ def register_components(m):
json=[{'Key': 'port_start', 'Value': comp_util.get_b64_conf("components/port_start")}]
)
m.register_uri(
+ 'GET', 'http://consul:8500/v1/kv/plugins?recurse=true',
+ json=[
+ {
+ "LockIndex": 0,
+ "Key": "plugins/authz",
+ "Flags": 0,
+ "Value": "eyJjb250YWluZXIiOiAid3Vrb25nc3VuL21vb25fYXV0aHo6djQuMyIsICJwb3J0IjogODA4MX0=",
+ "CreateIndex": 14,
+ "ModifyIndex": 656
+ }
+ ],
+ )
+ m.register_uri(
'PUT', 'http://consul:8500/v1/kv/components/port_start',
json=[]
)