Skip to content

Commit 91efbc9

Browse files
committed
add test_forward_compatibility_error
1 parent f09e76e commit 91efbc9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/test_validation_errors.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ def test_list_instead_of_nested_schema(unet2d_nuclei_broad_latest):
1111
data["run_mode"] = [{"name": "something"}]
1212

1313
error = validate(data)["error"]
14-
print(error)
1514
assert len(error) == 1
1615
assert error["run_mode"] == ["Expected dictionary, but got list."]
16+
17+
18+
def test_forward_compatibility_error(unet2d_fixed_shape):
19+
from bioimageio.spec.commands import validate
20+
21+
data = yaml.load(unet2d_fixed_shape)
22+
23+
data["authors"] = 42 # make sure rdf is invalid
24+
data["format_version"] = "9999.0.0" # assume it is valid in a future format version
25+
26+
error = validate(data)["error"]
27+
28+
# even though the format version is correctly formatted, it should be mentioned here as we treat the future format
29+
# version as the current latest. If this attempted forward compatibility fails we have to report that we did it.
30+
assert "format_version" in error

0 commit comments

Comments
 (0)