summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/ONAPLibrary/JSONKeywords.py
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-08-28 10:52:51 -0400
committerDR695H <dr695h@att.com>2019-08-28 11:21:56 -0400
commitf2b75da8dd38077c60cc2c852f73092980c1f906 (patch)
treef58fc4de4f54eec45e10717fabcb62d7cbe64182 /robotframework-onap/ONAPLibrary/JSONKeywords.py
parent566c583bbfe0b5a4e46af7ac53765a1340d11fc0 (diff)
fix linter errors and copyright
Change-Id: Idf7384307623c70a9f7714a5d276f404873c5974 Issue-ID: TEST-198 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robotframework-onap/ONAPLibrary/JSONKeywords.py')
-rw-r--r--robotframework-onap/ONAPLibrary/JSONKeywords.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/robotframework-onap/ONAPLibrary/JSONKeywords.py b/robotframework-onap/ONAPLibrary/JSONKeywords.py
index e007e6c..5b9e24e 100644
--- a/robotframework-onap/ONAPLibrary/JSONKeywords.py
+++ b/robotframework-onap/ONAPLibrary/JSONKeywords.py
@@ -11,10 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-import json
+import json
from robot.api.deco import keyword
from deepdiff import DeepDiff
+from six import string_types
class JSONKeywords(object):
@@ -28,11 +29,11 @@ class JSONKeywords(object):
def json_equals(self, left, right):
"""JSON Equals takes in two strings or json objects, converts them into json if needed and then compares them,
returning if they are equal or not."""
- if isinstance(left, str) or isinstance(left, unicode):
+ if isinstance(left, string_types):
left_json = json.loads(left)
else:
left_json = left
- if isinstance(right, str) or isinstance(right, unicode):
+ if isinstance(right, string_types):
right_json = json.loads(right)
else:
right_json = right