aboutsummaryrefslogtreecommitdiffstats
path: root/old/python_moonclient/tests/unit_python/mock_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'old/python_moonclient/tests/unit_python/mock_config.py')
-rw-r--r--old/python_moonclient/tests/unit_python/mock_config.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/old/python_moonclient/tests/unit_python/mock_config.py b/old/python_moonclient/tests/unit_python/mock_config.py
new file mode 100644
index 00000000..b6c42d76
--- /dev/null
+++ b/old/python_moonclient/tests/unit_python/mock_config.py
@@ -0,0 +1,64 @@
+from . import utilities
+
+
+components_manager_mock = {
+ "port": 8082,
+ "bind": "0.0.0.0",
+ "hostname": "manager",
+ "container": "wukongsun/moon_manager:v4.3.1",
+ "external": {
+ "port": 30001,
+ "hostname": "88.88.88.2"
+ }
+}
+
+
+openstack_keystone_mock = {
+ "url": "http://keystone:5000/v3",
+ "user": "admin",
+ "password": "p4ssw0rd",
+ "domain": "default",
+ "project": "admin",
+ "check_token": False,
+ "certificate": False,
+ "external": {
+ "url": "http://88.88.88.2:30006/v3"
+ }
+}
+
+
+def register_consul(m):
+ for component in utilities.COMPONENTS:
+ m.register_uri(
+ 'GET', 'http://consul:8500/v1/kv/{}'.format(component),
+ json=[{'Key': component, 'Value': utilities.get_b64_conf(component)}]
+ )
+
+ m.register_uri(
+ 'GET', 'http://manager:30001',
+ json={}
+ )
+ m.register_uri(
+ 'GET', 'http://keystone:5000/v3',
+ json={}
+ )
+ m.register_uri(
+ 'POST', 'http://keystone:5000/v3/auth/tokens',
+ headers={'X-Subject-Token': "111111111"}
+ )
+ m.register_uri(
+ 'DELETE', 'http://keystone:5000/v3/auth/tokens',
+ headers={'X-Subject-Token': "111111111"}
+ )
+ m.register_uri(
+ 'POST', 'http://keystone:5000/v3/users?name=testuser&domain_id=default',
+ json={"users": {}}
+ )
+ m.register_uri(
+ 'GET', 'http://keystone:5000/v3/users?name=testuser&domain_id=default',
+ json={"users": {}}
+ )
+ m.register_uri(
+ 'POST', 'http://keystone:5000/v3/users/',
+ json={"users": [{"id": "1111111111111"}]}
+ )