remove the 200 for sdc too 40/92140/2
authorDR695H <dr695h@att.com>
Fri, 26 Jul 2019 19:56:10 +0000 (15:56 -0400)
committerBrian Freeman <bf1936@att.com>
Mon, 29 Jul 2019 21:40:48 +0000 (21:40 +0000)
Issue-ID: TEST-174
Change-Id: I617b1efd11867b13e318387c49c29030c27bbe49
Signed-off-by: DR695H <dr695h@att.com>
robotframework-onap/ONAPLibrary/BaseSDCKeywords.py
robotframework-onap/ONAPLibrary/PreloadDataKeywords.py
robotframework-onap/ONAPLibrary/Utilities.py
robotframework-onap/ONAPLibrary/VariableHelper.py [moved from robotframework-onap/ONAPLibrary/VariableKeywords.py with 63% similarity]

index f3b93af..6f71078 100644 (file)
@@ -31,9 +31,7 @@ class BaseSDCKeywords(object):
     @keyword
     def run_get_request(self, endpoint, data_path, user, accept="application/json", auth=None):
         """Runs an SDC get request"""
-        resp = self.reqs.get_request("sdc", endpoint, data_path, sdc_user=user, accept=accept, auth=auth)
-        self.builtin.should_be_equal_as_strings(resp.status_code, "200")
-        return resp
+        return self.reqs.get_request("sdc", endpoint, data_path, sdc_user=user, accept=accept, auth=auth)
 
     @keyword
     def run_post_request(self, endpoint, data_path, data, user, accept="application/json", auth=None):
index cc16147..87d327b 100644 (file)
@@ -14,6 +14,7 @@
 
 from robot import utils
 from robot.api.deco import keyword
+from robot.libraries.BuiltIn import BuiltIn
 import os.path
 import json
 
@@ -25,6 +26,7 @@ class PreloadDataKeywords(object):
     def __init__(self):
         super(PreloadDataKeywords, self).__init__()
         self._cache = utils.ConnectionCache('No Preload Data directories loaded')
+        self.builtin = BuiltIn()
 
     @keyword
     def set_directory(self, alias, preload_data_directory):
index 4773432..5751e21 100644 (file)
@@ -18,7 +18,6 @@ from ONAPLibrary.SocketKeywords import SocketKeywords
 from ONAPLibrary.UUIDKeywords import UUIDKeywords
 from ONAPLibrary.HTTPKeywords import HTTPKeywords
 from ONAPLibrary.Base64Keywords import Base64Keywords
-from ONAPLibrary.VariableKeywords import VariableKeywords
 
 
 class Utilities(HybridCore):
@@ -32,7 +31,6 @@ class Utilities(HybridCore):
             SocketKeywords(),
             UUIDKeywords(),
             HTTPKeywords(),
-            Base64Keywords(),
-            VariableKeywords()
+            Base64Keywords()
         ]
         HybridCore.__init__(self, self.keyword_implementors)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from robot.api.deco import keyword
 from robot.libraries.BuiltIn import BuiltIn
 
 
-class VariableKeywords(object):
-    """ Utilities useful for working with varaibles """
+class VariableHelper(object):
+    """ Non keyword class for useful for working with varaibles """
 
     def __init__(self):
-        super(VariableKeywords, self).__init__()
+        super(VariableHelper, self).__init__()
         self.builtin = BuiltIn()
 
-    @keyword
     def get_globally_injected_parameters(self):
         dictionary = self.builtin.get_variables(no_decoration=True)
-        return self.filter_variables_by_key_prefix(dictionary, "GLOBAL_INJECTED")
+        return self.filter_variables_by_key_prefix(dictionary, "GLOBAL_INJECTED_")
 
-    @keyword
-    def filter_variables_by_key_prefix(self, dictionary, partial):
+    def get_global_parameters(self):
+        dictionary = self.builtin.get_variables(no_decoration=True)
+        global_variables = self.filter_variables_by_key_prefix(dictionary, "GLOBAL_")
+        # strip out global injected (get those above)
+        for key in self.get_globally_injected_parameters():
+            del global_variables[key]
+        return global_variables
+
+    @staticmethod
+    def filter_variables_by_key_prefix(dictionary, partial):
         matches = dict()
         for key, val in dictionary.items():
             if key.startswith(partial):