diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e9415033..efd27986 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, pypy-3.8, pypy-3.9, pypy-3.10, '3.10', '3.11' , '3.12.0-beta.4'] + python-version: [3.8, 3.9, pypy-3.8, pypy-3.9, pypy-3.10, '3.10', '3.11' , '3.12.0-rc.1'] os: [ ubuntu-latest, windows-latest, diff --git a/README.rst b/README.rst index 532eb29b..60018005 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ The library can be used in these ways: from json2xml.utils import readfromurl, readfromstring, readfromjson # get the xml from an URL that return json - data = readfromurl("https://coderwall.com/vinitcool76.json") + data = readfromurl("https://api.publicapis.org/entries") print(json2xml.Json2xml(data).to_xml()) # get the xml from a json string like this: diff --git a/json2xml/dicttoxml.py b/json2xml/dicttoxml.py index 3302753a..ace0e693 100644 --- a/json2xml/dicttoxml.py +++ b/json2xml/dicttoxml.py @@ -247,7 +247,7 @@ def dict2xml_str( val_attr: dict[str, str] = item.pop("@attrs", attr) # update attr with custom @attr if exists rawitem = item["@val"] if "@val" in item else item if is_primitive_type(rawitem): - if type(rawitem) == str: + if isinstance(rawitem , str): subtree = escape_xml(rawitem) else: subtree = rawitem diff --git a/tests/test_json2xml.py b/tests/test_json2xml.py index 4c3e552e..c1e965c9 100644 --- a/tests/test_json2xml.py +++ b/tests/test_json2xml.py @@ -51,12 +51,12 @@ def test_read_from_invalid_json2(self): assert pytest_wrapped_e.type == JSONReadError def test_read_from_url(self): - data = readfromurl("https://coderwall.com/vinitcool76.json") + data = readfromurl("https://api.publicapis.org/entries") assert type(data) is dict def test_read_from_wrong_url(self): with pytest.raises(URLReadError) as pytest_wrapped_e: - readfromurl("https://coderwall.com/vinitcool76.jsoni") + readfromurl("https://api.publicapis.org/entriesi") assert pytest_wrapped_e.type == URLReadError def test_read_from_jsonstring(self):