Skip to content

Commit 1526afc

Browse files
authored
Merge pull request #42 from elrandira/master
Release 0.4 (second attempt)
2 parents 6d90f6a + eb59a98 commit 1526afc

File tree

8 files changed

+1274
-333
lines changed

8 files changed

+1274
-333
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: python
22
python:
3-
- "3.7"
3+
- "3.9"
44
install: "pip install -r requirements.txt"
55
script: make clean coverage docs dist
66
deploy:

JSONLibrary/JSONLibraryKeywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def convert_string_to_json(self, json_string):
179179
return json.loads(json_string)
180180

181181
@keyword("Dump JSON To File")
182-
def dump_json_to_file(self, dest_file, json_object):
182+
def dump_json_to_file(self, dest_file, json_object, encoding=None):
183183
"""Dump JSON to file
184184
185185
Arguments:
@@ -192,7 +192,7 @@ def dump_json_to_file(self, dest_file, json_object):
192192
| Dump JSON To File | ${OUTPUTID)${/}output.json | ${json} |
193193
"""
194194
json_str = self.convert_json_to_string(json_object)
195-
with open(dest_file, "w") as json_file:
195+
with open(dest_file, "w", encoding=encoding) as json_file:
196196
json_file.write(json_str)
197197
return str(dest_file)
198198

JSONLibrary/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
VERSION = "0.3.1"
4+
VERSION = "0.4"

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@ JSONPath is an expression which can help to access to your JSON document. The JS
1818

1919
This library can help you to add, get, update and delete your JSON object. So it's very useful in case that you have a very large JSON object.
2020

21+
# Notes
22+
23+
Please note this library is a bridge between the Robot Framework and the parser jsonpath-ng. Hence, issues related to parsing should be raised on https://github.com/h2non/jsonpath-ng
24+
25+
Starting with version 0.4, Python2 support is dropped as Python2 reached end of life on 1st of January 2020.
26+
2127
# Usage
28+
2229
Install robotframework-jsonlibrary via ``pip`` command
2330
```bash
2431
pip install -U robotframework-jsonlibrary
2532
```
33+
2634
# Example Test Case
2735

2836
*** Settings *** | | | | |
@@ -51,6 +59,14 @@ For an example of JSONPath expressions. Go to this link:
5159

5260
https://goessner.net/articles/JsonPath/index.html#e3
5361

62+
Parser: jsonpath-ng:
63+
64+
https://github.com/h2non/jsonpath-ng
65+
66+
This github:
67+
68+
https://github.com/robotframework-thailand/robotframework-jsonlibrary
69+
5470
#Help & Issues
5571
Mention me on Twitter [@nottyo](https://twitter.com/nottyo)
5672

0 commit comments

Comments
 (0)