Skip to content

Commit 6ea9f57

Browse files
committed
Update tests to repeated expected .json behavior for .jsonld
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent f7d04ee commit 6ea9f57

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/case_utils/test_guess_format.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
PATH_TO_TTL = "/nonexistent/foo.ttl"
2020
PATH_TO_JSON = "/nonexistent/foo.json"
21+
PATH_TO_JSONLD = "/nonexistent/foo.jsonld"
2122
PATH_TO_XHTML = "/nonexistent/foo.xhtml"
2223
FMAP_XHTML_GRDDL = {"xhtml": "grddl"}
2324

@@ -41,6 +42,10 @@ def test_rdflib_util_guess_format_ttl_fmap():
4142
def test_rdflib_util_guess_format_json():
4243
assert rdflib.util.guess_format(PATH_TO_JSON) == "json-ld", "Failed to recognize .json RDF file extension"
4344

45+
@pytest.mark.xfail(reason="rdflib 5.0.0 known to not recognize .jsonld", strict=True)
46+
def test_rdflib_util_guess_format_jsonld():
47+
assert rdflib.util.guess_format(PATH_TO_JSONLD) == "json-ld", "Failed to recognize .jsonld RDF file extension"
48+
4449
def test_case_utils_guess_format_ttl_default():
4550
assert case_utils.guess_format(PATH_TO_TTL) == "turtle", "Failed to recognize .ttl RDF file extension"
4651

@@ -54,3 +59,10 @@ def test_case_utils_guess_format_json_default():
5459
@pytest.mark.xfail(reason="Preserving behavior - rdflib 5.0.0 guess_format fmap argument overwrites base module's extension map", strict=True)
5560
def test_case_utils_guess_format_json_fmap():
5661
assert case_utils.guess_format(PATH_TO_JSON, FMAP_XHTML_GRDDL) == "json-ld", "Failed to recognize .json RDF file extension when using fmap"
62+
63+
def test_case_utils_guess_format_jsonld_default():
64+
assert case_utils.guess_format(PATH_TO_JSONLD) == "json-ld", "Failed to recognize .jsonld RDF file extension"
65+
66+
@pytest.mark.xfail(reason="Preserving behavior - rdflib 5.0.0 guess_format fmap argument overwrites base module's extension map", strict=True)
67+
def test_case_utils_guess_format_jsonld_fmap():
68+
assert case_utils.guess_format(PATH_TO_JSONLD, FMAP_XHTML_GRDDL) == "json-ld", "Failed to recognize .jsonld RDF file extension when using fmap"

0 commit comments

Comments
 (0)