Skip to content

Commit 753f3e8

Browse files
Extend tf weight converter test
1 parent beadefd commit 753f3e8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/weight_converter/keras/test_tensorflow.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import zipfile
2+
3+
14
def test_tensorflow_converter(any_keras_model, tmp_path):
25
from bioimageio.core.weight_converter.keras import convert_weights_to_tensorflow_saved_model_bundle
36

@@ -16,3 +19,9 @@ def test_tensorflow_converter_zipped(any_keras_model, tmp_path):
1619
ret_val = convert_weights_to_tensorflow_saved_model_bundle(any_keras_model, out_path)
1720
assert out_path.exists()
1821
assert ret_val == 0 # check for correctness is done in converter and returns 0 if it passes
22+
23+
# make sure that the zip package was created correctly
24+
expected_names = {"saved_model.pb", "variables/variables.index"}
25+
with zipfile.ZipFile(out_path, "r") as f:
26+
names = set([name for name in f.namelist()])
27+
assert len(expected_names - names) == 0

0 commit comments

Comments
 (0)