@@ -211,6 +211,43 @@ def test_cli_convert_zarr_to_ozx_and_back(tmpdir):
211211 np .testing .assert_array_equal (pos ["0" ][:], np .arange (16 , dtype = np .uint8 ).reshape (1 , 1 , 1 , 4 , 4 ))
212212
213213
214+ @pytest .mark .parametrize (
215+ ("flag" , "value" , "route" ),
216+ [
217+ ("--chunks" , "XY" , "pack" ),
218+ ("-g" , None , "pack" ),
219+ ("--chunks" , "XY" , "unpack" ),
220+ ("-g" , None , "unpack" ),
221+ ("--ome-zarr-version" , "0.5" , "unpack" ),
222+ ],
223+ )
224+ def test_cli_convert_rejects_irrelevant_flags (tmpdir , flag , value , route ):
225+ """TIFF-only flags on pack/unpack and version on unpack must error loudly."""
226+ import numpy as np
227+
228+ from tests .conftest import make_fov_zarr
229+
230+ src_zarr = Path (tmpdir ) / "src.zarr"
231+ make_fov_zarr (src_zarr , np .zeros ((1 , 1 , 1 , 2 , 2 ), dtype = np .uint8 ))
232+ if route == "pack" :
233+ src , dst = src_zarr , Path (tmpdir ) / "out.ozx"
234+ else :
235+ ozx = Path (tmpdir ) / "src.ozx"
236+ from iohub .core .ozx import pack_ozx as _pack
237+
238+ _pack (src_zarr , ozx )
239+ src , dst = ozx , Path (tmpdir ) / "out.zarr"
240+
241+ cmd = ["convert" , "-i" , str (src ), "-o" , str (dst ), flag ]
242+ if value is not None :
243+ cmd .append (value )
244+
245+ runner = CliRunner ()
246+ res = runner .invoke (cli , cmd )
247+ assert res .exit_code != 0
248+ assert "do not apply" in res .output or "apply only" in res .output
249+
250+
214251def test_cli_set_scale (caplog ):
215252 with _temp_copy (hcs_ref ) as store_path :
216253 store_path = Path (store_path )
0 commit comments