aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_interface/tests
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2017-06-02 14:54:15 +0200
committerasteroide <thomas.duval@orange.com>2017-06-02 14:54:15 +0200
commit739f67b914a354e858e629d854a4860aaebabbdf (patch)
tree5292539f5bc6193bfeb3c06e81afc4fb19743df1 /moonv4/moon_interface/tests
parenta1422ba18a20dada1c3c8cf9bbd732fb4d315976 (diff)
Add the possibility to set the moon URL
Change-Id: If3a05c63457b4e74175a26d317b21ceb2faace7d
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