moving http to new keyword format 34/90034/1
authorDR695H <dr695h@att.com>
Mon, 17 Jun 2019 17:31:29 +0000 (13:31 -0400)
committerDR695H <dr695h@att.com>
Mon, 17 Jun 2019 17:31:35 +0000 (13:31 -0400)
Issue-ID: TEST-158
Change-Id: Ib0accb92a39a50fdc63227768a5fe628930c91df
Signed-off-by: DR695H <dr695h@att.com>
robotframework-onap/ONAPLibrary/HTTPKeywords.py [new file with mode: 0644]
robotframework-onap/ONAPLibrary/Utilities.py
robotframework-onap/eteutils/HTTPUtils.py [deleted file]
robotframework-onap/eteutils/OSUtils.py [deleted file]

diff --git a/robotframework-onap/ONAPLibrary/HTTPKeywords.py b/robotframework-onap/ONAPLibrary/HTTPKeywords.py
new file mode 100644 (file)
index 0000000..40f9998
--- /dev/null
@@ -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)
index 9f1e0c0..8c1f355 100644 (file)
@@ -16,6 +16,7 @@ from ONAPLibrary.robotlibcore import HybridCore
 from ONAPLibrary.DNSKeywords import DNSKeywords
 from ONAPLibrary.SocketKeywords import SocketKeywords
 from ONAPLibrary.UUIDKeywords import UUIDKeywords
+from ONAPLibrary.HTTPKeywords import HTTPKeywords
 
 
 class Utilities(HybridCore):
@@ -25,6 +26,7 @@ class Utilities(HybridCore):
         self.keyword_implementors = [
             DNSKeywords(),
             SocketKeywords(),
-            UUIDKeywords()
+            UUIDKeywords(),
+            HTTPKeywords()
         ]
         HybridCore.__init__(self, self.keyword_implementors)
diff --git a/robotframework-onap/eteutils/HTTPUtils.py b/robotframework-onap/eteutils/HTTPUtils.py
deleted file mode 100644 (file)
index f5c8fe4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-from six.moves.urllib.parse import urlparse
-from six.moves import urllib
-
-import urllib3
-
-
-class HTTPUtils:
-    """HTTPUtils is common resource for simple http helper keywords."""
-
-    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)
-
-    def disable_warnings(self):
-        """  Disable all warnings when creating sessions """
-        urllib3.disable_warnings()
-
-    def url_parse(self, url):
-        """  Get pieces of the URL """
-        return urlparse(url)
diff --git a/robotframework-onap/eteutils/OSUtils.py b/robotframework-onap/eteutils/OSUtils.py
deleted file mode 100644 (file)
index 78968f0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-from sys import platform
-
-class OSUtils:
-    """ Utilities useful for constructing OpenStack HEAT requests """
-
-    def get_normalized_os(self):
-        os = platform
-        if platform == "linux" or platform == "linux2":
-            os = 'linux64'
-        elif platform == "darwin":
-            os = 'mac64'
-        elif platform == "win32":
-            os = platform
-        return os