summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/ONAPLibrary/HTTPKeywords.py
diff options
context:
space:
mode:
Diffstat (limited to 'robotframework-onap/ONAPLibrary/HTTPKeywords.py')
-rw-r--r--robotframework-onap/ONAPLibrary/HTTPKeywords.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/robotframework-onap/ONAPLibrary/HTTPKeywords.py b/robotframework-onap/ONAPLibrary/HTTPKeywords.py
new file mode 100644
index 0000000..40f9998
--- /dev/null
+++ b/robotframework-onap/ONAPLibrary/HTTPKeywords.py
@@ -0,0 +1,18 @@
+from six.moves import urllib
+from robot.api.deco import keyword
+
+
+class HTTPKeywords(object):
+ """HTTPKeywords is common resource for simple http helper keywords."""
+ def __init__(self):
+ super(HTTPKeywords, self).__init__()
+
+ @keyword
+ def url_encode_string(self, barestring):
+ """URL Encode String takes in a string and converts it into fully 'percent-encoded' string"""
+ return urllib.parse.quote(barestring)
+
+ @keyword
+ def url_parse(self, url):
+ """ Get pieces of the URL """
+ return urllib.parse.urlparse(url)