Skip to content

Commit 255f2b2

Browse files
committed
Adjust tests nquad output
1 parent 851ed16 commit 255f2b2

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

tests/test_jsonld.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -891,13 +891,15 @@ def test_conflicting_property_names(self):
891891
"dublinCore": {"title": "Chapter 1: Jonathan Harker's Journal"},
892892
}
893893

894-
expected = """<http://foo.bar/obj/test> <http://foo.bar/dc> _:b0 .
895-
<http://foo.bar/obj/test> <http://foo.bar/title> "test" .
896-
_:b0 <http://purl.org/dc/terms/title> "Chapter 1: Jonathan Harker's Journal" .
894+
expected = """<http://foo.bar/obj/test> <http://foo.bar/title> "test"^^<http://www.w3.org/2001/XMLSchema#string> .
895+
<http://foo.bar/obj/test> <http://foo.bar/dc> _:b0 .
896+
_:b0 <http://purl.org/dc/terms/title> "Chapter 1: Jonathan Harker's Journal"^^<http://www.w3.org/2001/XMLSchema#string> .
897+
897898
"""
898899

899900
nquads = jsonld.to_rdf(input, options={'format': 'application/n-quads'})
900-
assert nquads == expected
901+
# TODO: move this into a helper function for comparing nquads
902+
assert sorted(nquads.splitlines()) == sorted(expected.splitlines())
901903

902904

903905
def test_conflicting_property_names_in_nested_node(self):
@@ -918,12 +920,14 @@ def test_conflicting_property_names_in_nested_node(self):
918920
"dublinCore": {"title": "Chapter 1: Jonathan Harker's Journal"},
919921
}
920922

921-
expected = """<http://foo.bar/obj/test> <http://foo.bar/title> "test" .
922-
<http://foo.bar/obj/test> <http://purl.org/dc/terms/title> "Chapter 1: Jonathan Harker's Journal" .
923+
expected = """<http://foo.bar/obj/test> <http://foo.bar/title> "test"^^<http://www.w3.org/2001/XMLSchema#string> .
924+
<http://foo.bar/obj/test> <http://purl.org/dc/terms/title> "Chapter 1: Jonathan Harker's Journal"^^<http://www.w3.org/2001/XMLSchema#string> .
925+
923926
"""
924927

925928
nquads = jsonld.to_rdf(input, options={'format': 'application/n-quads'})
926-
assert nquads == expected
929+
# TODO: move this into a helper function for comparing nquads
930+
assert sorted(nquads.splitlines()) == sorted(expected.splitlines())
927931

928932

929933
class TestCompact:

0 commit comments

Comments
 (0)