aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/tests/utils/models.py
diff options
context:
space:
mode:
authorRHE <rebirthmonkey@gmail.com>2017-12-18 18:37:37 +0100
committerThomas Duval <thomas.duval@orange.com>2017-12-20 10:02:53 +0100
commit12d66121165397cc995e0f5a5873391c18279c0a (patch)
tree57ae937952230fa6a5d5eebf9c2fa50154789658 /moonv4/tests/utils/models.py
parent4894aee58df3e898c351f006d9d7648a7bb437ee (diff)
fix moon functional tests
Change-Id: I9ebc0d8d20cca44a083d85a49587e7249a85b5bd Signed-off-by: RHE <rebirthmonkey@gmail.com>
Diffstat (limited to 'moonv4/tests/utils/models.py')
-rw-r--r--moonv4/tests/utils/models.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/moonv4/tests/utils/models.py b/moonv4/tests/utils/models.py
index 3cf31354..61fa6179 100644
--- a/moonv4/tests/utils/models.py
+++ b/moonv4/tests/utils/models.py
@@ -2,13 +2,8 @@ import requests
import copy
import utils.config
-config = utils.config.get_config_data()
-
-URL = "http://{}:{}".format(
- config['components']['manager']['hostname'],
- config['components']['manager']['port'])
-URL = URL + "{}"
-HEADERS = {"content-type": "application/json"}
+URL = None
+HEADERS = None
model_template = {
"name": "test_model",
@@ -29,6 +24,16 @@ meta_rule_template = {
}
+def init(consul_host, consul_port):
+ conf_data = utils.config.get_config_data(consul_host, consul_port)
+ global URL, HEADERS
+ URL = "http://{}:{}".format(
+ conf_data['manager_host'],
+ conf_data['manager_port'])
+ URL = URL + "{}"
+ HEADERS = {"content-type": "application/json"}
+
+
def check_model(model_id=None, check_model_name=True):
req = requests.get(URL.format("/models"))
assert req.status_code == 200