aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_interface/tests
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/moon_interface/tests')
-rw-r--r--moonv4/moon_interface/tests/apitests/utils/pdp.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/moonv4/moon_interface/tests/apitests/utils/pdp.py b/moonv4/moon_interface/tests/apitests/utils/pdp.py
index 7b6287b9..6a27224e 100644
--- a/moonv4/moon_interface/tests/apitests/utils/pdp.py
+++ b/moonv4/moon_interface/tests/apitests/utils/pdp.py
@@ -2,7 +2,8 @@ import requests
import configparser
config = configparser.ConfigParser()
-config.read("/etc/moon/moon.conf")
+if not config.read("moon.conf"):
+ config.read("/etc/moon/moon.conf")
URL = "http://{}:{}".format(config['interface']['host'], config['interface']['port'])
HEADERS = {"content-type": "application/json"}
@@ -67,8 +68,11 @@ def get_keystone_projects():
return req.json()
-def check_pdp(pdp_id=None, keystone_project_id=None):
- req = requests.get(URL + "/pdp")
+def check_pdp(pdp_id=None, keystone_project_id=None, moon_url=None):
+ _URL = URL
+ if moon_url:
+ _URL = moon_url
+ req = requests.get(_URL + "/pdp")
assert req.status_code == 200
result = req.json()
assert type(result) is dict