diff options
Diffstat (limited to 'moonv4/tests/utils/models.py')
-rw-r--r-- | moonv4/tests/utils/models.py | 19 |
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 |