Skip to content

Commit 7335437

Browse files
authored
Merge pull request #39 from elrandira/master
issue #17
2 parents 3c06293 + 6a4a3a4 commit 7335437

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

JSONLibrary/JSONLibraryKeywords.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def parse(json_path):
2626
class JSONLibraryKeywords(object):
2727
ROBOT_EXIT_ON_FAILURE = True
2828

29-
@keyword('Load JSON From File')
29+
@keyword("Load JSON From File")
3030
def load_json_from_file(self, file_name, encoding=None):
3131
"""Load JSON from file.
3232
@@ -49,7 +49,7 @@ def load_json_from_file(self, file_name, encoding=None):
4949
data = json.load(json_file)
5050
return data
5151

52-
@keyword('Add Object To Json')
52+
@keyword("Add Object To Json")
5353
def add_object_to_json(self, json_object, json_path, object_to_add):
5454
"""Add an dictionary or list object to json object using json_path
5555
@@ -85,7 +85,7 @@ def add_object_to_json(self, json_object, json_path, object_to_add):
8585

8686
return json_object
8787

88-
@keyword('Get Value From Json')
88+
@keyword("Get Value From Json")
8989
def get_value_from_json(self, json_object, json_path):
9090
"""Get Value From JSON using JSONPath
9191
@@ -105,7 +105,7 @@ def get_value_from_json(self, json_object, json_path):
105105
f"Get Value From Json keyword failed to find a value for {json_path}")
106106
return [match.value for match in rv]
107107

108-
@keyword('Update Value To Json')
108+
@keyword("Update Value To Json")
109109
def update_value_to_json(self, json_object, json_path, new_value):
110110
"""Update value to JSON using JSONPath
111111
@@ -128,7 +128,7 @@ def update_value_to_json(self, json_object, json_path, new_value):
128128
match.context.value[match.path.fields[0]] = new_value
129129
return json_object
130130

131-
@keyword('Delete Object From Json')
131+
@keyword("Delete Object From Json")
132132
def delete_object_from_json(self, json_object, json_path):
133133
"""Delete Object From JSON using json_path
134134
@@ -150,7 +150,7 @@ def delete_object_from_json(self, json_object, json_path):
150150
del(match.context.value[match.path.fields[0]])
151151
return json_object
152152

153-
@keyword('Convert JSON To String')
153+
@keyword("Convert JSON To String")
154154
def convert_json_to_string(self, json_object):
155155
"""Convert JSON object to string
156156
@@ -164,7 +164,7 @@ def convert_json_to_string(self, json_object):
164164
"""
165165
return json.dumps(json_object)
166166

167-
@keyword('Convert String To JSON')
167+
@keyword("Convert String To JSON")
168168
def convert_string_to_json(self, json_string):
169169
"""Convert String to JSON object
170170
@@ -178,7 +178,7 @@ def convert_string_to_json(self, json_string):
178178
"""
179179
return json.loads(json_string)
180180

181-
@keyword('Dump JSON To File')
181+
@keyword("Dump JSON To File")
182182
def dump_json_to_file(self, dest_file, json_object):
183183
"""Dump JSON to file
184184
@@ -196,7 +196,7 @@ def dump_json_to_file(self, dest_file, json_object):
196196
json_file.write(json_str)
197197
return str(dest_file)
198198

199-
@keyword('Should Have Value In Json')
199+
@keyword("Should Have Value In Json")
200200
def should_have_value_in_json(self, json_object, json_path):
201201
"""Should Have Value In JSON using JSONPath
202202
@@ -215,7 +215,7 @@ def should_have_value_in_json(self, json_object, json_path):
215215
fail(f"No value found for path {json_path}")
216216

217217

218-
@keyword('Should Not Have Value In Json')
218+
@keyword("Should Not Have Value In Json")
219219
def should_not_have_value_in_json(self, json_object, json_path):
220220
"""Should Not Have Value In JSON using JSONPath
221221

0 commit comments

Comments
 (0)