summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-07-11 11:57:29 -0400
committerDR695H <dr695h@att.com>2019-07-11 11:57:29 -0400
commit335a1c8082c8e7788e56307a9c03a8511500a687 (patch)
tree6c19adff23737743bac2651ae747db50f982e794 /robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py
parent1afa01d5848f9a7a99c436397ebc019cee7fb362 (diff)
moving basic rest calls to requestshelper
Issue-ID: TEST-173 Change-Id: I76736b52a48510ce0a6f44607401b8e127a87476 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py')
-rw-r--r--robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py41
1 files changed, 3 insertions, 38 deletions
diff --git a/robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py b/robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py
index 14bfb54..f335aea 100644
--- a/robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py
+++ b/robotframework-onap/ONAPLibrary/BaseSDNCKeywords.py
@@ -31,51 +31,16 @@ class BaseSDNCKeywords(object):
@keyword
def run_get_request(self, endpoint, data_path, accept="application/json", auth=None):
"""Runs an SDNC get request"""
- resp = self.get_request(endpoint, data_path, accept, auth)
+ resp = self.reqs.get_request("sdnc", endpoint, data_path, accept, auth)
self.builtin.should_be_equal_as_strings(resp.status_code, "200")
return resp
@keyword
def run_post_request(self, endpoint, data_path, data, accept="application/json", auth=None):
"""Runs an SDNC post request"""
- return self.post_request(endpoint, data_path, data, accept, auth)
+ return self.reqs.post_request("sdnc", endpoint, data_path, data, accept, auth)
@keyword
def run_put_request(self, endpoint, data_path, data, accept="application/json", auth=None):
"""Runs an SDNC post request"""
- return self.put_request(endpoint, data_path, data, accept, auth)
-
- def get_request(self, endpoint, data_path, accept="application/json", auth=None):
- """Runs an SDNC get request"""
- logger.info("Creating session" + endpoint)
- RequestsLibrary().create_session("sdnc", endpoint, auth=auth)
- resp = RequestsLibrary().get_request("sdnc", data_path, headers=self.reqs.create_headers(accept))
- logger.info("Received response from sdnc " + resp.text)
- return resp
-
- def post_request(self, endpoint, data_path, data, accept="application/json", auth=None):
- """Runs an sdnc post request"""
- logger.info("Creating session" + endpoint)
- RequestsLibrary().create_session("sdnc", endpoint, auth=auth)
- headers = self.reqs.create_headers(accept=accept)
- resp = RequestsLibrary().post_request("sdnc", data_path, data=data, headers=headers)
- logger.info("Received response from sdnc " + resp.text)
- return resp
-
- def put_request(self, endpoint, data_path, data, accept="application/json", auth=None):
- """Runs an sdnc post request"""
- logger.info("Creating session" + endpoint)
- RequestsLibrary().create_session("sdnc", endpoint, auth=auth)
- headers = self.reqs.create_headers(accept=accept)
- resp = RequestsLibrary().put_request("sdnc", data_path, data=data, headers=headers)
- logger.info("Received response from sdnc " + resp.text)
- return resp
-
- def delete_request(self, endpoint, data_path, data, accept="application/json", auth=None):
- """Runs an sdnc post request"""
- logger.info("Creating session" + endpoint)
- RequestsLibrary().create_session("sdnc", endpoint, auth=auth)
- headers = self.reqs.create_headers(accept=accept)
- resp = RequestsLibrary().delete_request("sdnc", data_path, data=data, headers=headers)
- logger.info("Received response from sdnc " + resp.text)
- return resp
+ return self.reqs.put_request("sdnc", endpoint, data_path, data, accept, auth) \ No newline at end of file