Skip to content

Commit

Permalink
test crate creation with dict source and init=True
Browse files Browse the repository at this point in the history
  • Loading branch information
simleo committed Mar 3, 2025
1 parent 1c62c99 commit a92cc3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rocrate/rocrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(self, source=None, gen_preview=False, init=False, exclude=None):
self.add(RootDataset(self), Metadata(self))
elif init:
if isinstance(source, dict):
raise ValueError("parameter init is not compatible with a JsonLD source")
raise ValueError("parameter 'init' is not compatible with a dict source")
self.__init_from_tree(source, gen_preview=gen_preview)
else:
source = self.__read(source, gen_preview=gen_preview)
Expand Down
2 changes: 2 additions & 0 deletions test/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,3 +595,5 @@ def test_from_dict(tmpdir):
for entity in d1, d2, f1:
entity.source = None
crate.write(out_path)
with pytest.raises(ValueError):
ROCrate(metadata, init=True)

0 comments on commit a92cc3b

Please sign in to comment.