Skip to content

Commit

Permalink
update test_entity_as_mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
simleo committed Sep 11, 2024
1 parent df66def commit 1391dc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def test_entity_as_mapping(tmpdir, helpers):
crate_dir.mkdir()
with open(crate_dir / helpers.METADATA_FILE_NAME, "wt") as f:
json.dump(metadata, f, indent=4)
with pytest.raises(ValueError):
with pytest.raises(ValueError): # due to "badProp", which has no "@id"
crate = ROCrate(crate_dir)
del metadata["@graph"][2]["badProp"]
with open(crate_dir / helpers.METADATA_FILE_NAME, "wt") as f:
Expand Down Expand Up @@ -416,7 +416,9 @@ def test_entity_as_mapping(tmpdir, helpers):
"application/json",
"https://www.json.org",
}
correction._jsonld["badProp"] = {"k": "v"}
with pytest.raises(ValueError):
correction["badProp"] = {"k": "v"} # value has no "@id"
correction._jsonld["badProp"] = {"k": "v"} # force set using _jsonld
with pytest.raises(ValueError):
correction["badProp"]

Expand Down

0 comments on commit 1391dc3

Please sign in to comment.