Skip to content

Commit

Permalink
fix test_package
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Nov 8, 2024
1 parent bdef5f6 commit e098415
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@ def test_package(unet2d_path: Path):
from bioimageio.spec import dump_description, load_description

descr = load_description(unet2d_path)
rdf = dump_description(descr)
rdf1 = dump_description(descr)
zip = descr.package()
descr2 = load_description(zip)
rdf2 = dump_description(descr2)
diff = DeepDiff(rdf, rdf2)

# assert expected differences
assert (
rdf1["weights"]["pytorch_state_dict"].pop("source") # type: ignore
== "https://zenodo.org/records/3446812/files/unet2d_weights.torch"
)
assert (
rdf2["weights"]["pytorch_state_dict"].pop("source") # type: ignore
== "unet2d_weights.torch"
)

diff = DeepDiff(rdf1, rdf2)
assert not diff, diff.pretty()
assert descr == descr2


def test_save_bioimageio_package(unet2d_path: Path):
Expand Down

0 comments on commit e098415

Please sign in to comment.