From 1391dc370510e61dfaad3e473a6703ee714f0643 Mon Sep 17 00:00:00 2001 From: simleo Date: Wed, 11 Sep 2024 17:06:22 +0200 Subject: [PATCH] update test_entity_as_mapping --- test/test_model.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_model.py b/test/test_model.py index f6e18af..c452e21 100644 --- a/test/test_model.py +++ b/test/test_model.py @@ -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: @@ -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"]