Skip to content

Commit 7f86378

Browse files
committed
attachments might be missing
1 parent 6e7bab5 commit 7f86378

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/build_spec/test_build_spec.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import bioimageio.spec as spec
22
from bioimageio.core import load_raw_resource_description, load_resource_description
3+
from bioimageio.core.resource_io import nodes
34
from bioimageio.core.resource_io.utils import resolve_source
45
from marshmallow import missing
56

@@ -84,11 +85,12 @@ def _test_build_spec(
8485
build_model(**kwargs)
8586
assert out_path.exists()
8687
loaded_model = load_resource_description(out_path)
88+
assert isinstance(loaded_model, nodes.Model)
8789
if add_deepimagej_config:
8890
loaded_config = loaded_model.config
8991
assert "deepimagej" in loaded_config
9092

91-
attachments = loaded_model.attachments
93+
attachments = loaded_model.attachments or {}
9294
if "files" in attachments:
9395
for attached_file in attachments["files"]:
9496
assert attached_file.exists()

0 commit comments

Comments
 (0)