@@ -84,7 +84,7 @@ class TestWithMocks:
84
84
vcf_path = "tests/data/vcf/sample.vcf.gz"
85
85
86
86
@pytest .mark .parametrize (("progress" , "flag" ), [(True , "-P" ), (False , "-Q" )])
87
- @mock .patch ("bio2zarr.icf .explode" )
87
+ @mock .patch ("bio2zarr.vcf .explode" )
88
88
def test_vcf_explode (self , mocked , tmp_path , progress , flag ):
89
89
icf_path = tmp_path / "icf"
90
90
runner = ct .CliRunner (mix_stderr = False )
@@ -101,7 +101,7 @@ def test_vcf_explode(self, mocked, tmp_path, progress, flag):
101
101
mocked .assert_called_once_with (str (icf_path ), (self .vcf_path ,), ** args )
102
102
103
103
@pytest .mark .parametrize ("compressor" , ["lz4" , "zstd" ])
104
- @mock .patch ("bio2zarr.icf .explode" )
104
+ @mock .patch ("bio2zarr.vcf .explode" )
105
105
def test_vcf_explode_compressor (self , mocked , tmp_path , compressor ):
106
106
icf_path = tmp_path / "icf"
107
107
runner = ct .CliRunner (mix_stderr = False )
@@ -124,7 +124,7 @@ def test_vcf_explode_compressor(self, mocked, tmp_path, compressor):
124
124
)
125
125
126
126
@pytest .mark .parametrize ("compressor" , ["lz4" , "zstd" ])
127
- @mock .patch ("bio2zarr.icf .explode_init" )
127
+ @mock .patch ("bio2zarr.vcf .explode_init" )
128
128
def test_vcf_dexplode_init_compressor (self , mocked , tmp_path , compressor ):
129
129
icf_path = tmp_path / "icf"
130
130
runner = ct .CliRunner (mix_stderr = False )
@@ -148,7 +148,7 @@ def test_vcf_dexplode_init_compressor(self, mocked, tmp_path, compressor):
148
148
)
149
149
150
150
@pytest .mark .parametrize ("compressor" , ["LZ4" , "asdf" ])
151
- @mock .patch ("bio2zarr.icf .explode" )
151
+ @mock .patch ("bio2zarr.vcf .explode" )
152
152
def test_vcf_explode_bad_compressor (self , mocked , tmp_path , compressor ):
153
153
runner = ct .CliRunner (mix_stderr = False )
154
154
icf_path = tmp_path / "icf"
@@ -161,7 +161,7 @@ def test_vcf_explode_bad_compressor(self, mocked, tmp_path, compressor):
161
161
assert "Invalid value for '-C'" in result .stderr
162
162
mocked .assert_not_called ()
163
163
164
- @mock .patch ("bio2zarr.icf .explode" )
164
+ @mock .patch ("bio2zarr.vcf .explode" )
165
165
def test_vcf_explode_multiple_vcfs (self , mocked , tmp_path ):
166
166
icf_path = tmp_path / "icf"
167
167
runner = ct .CliRunner (mix_stderr = False )
@@ -178,7 +178,7 @@ def test_vcf_explode_multiple_vcfs(self, mocked, tmp_path):
178
178
)
179
179
180
180
@pytest .mark .parametrize ("response" , ["y" , "Y" , "yes" ])
181
- @mock .patch ("bio2zarr.icf .explode" )
181
+ @mock .patch ("bio2zarr.vcf .explode" )
182
182
def test_vcf_explode_overwrite_icf_confirm_yes (self , mocked , tmp_path , response ):
183
183
icf_path = tmp_path / "icf"
184
184
icf_path .mkdir ()
@@ -197,7 +197,7 @@ def test_vcf_explode_overwrite_icf_confirm_yes(self, mocked, tmp_path, response)
197
197
)
198
198
199
199
@pytest .mark .parametrize ("response" , ["y" , "Y" , "yes" ])
200
- @mock .patch ("bio2zarr.icf .encode" )
200
+ @mock .patch ("bio2zarr.vcf .encode" )
201
201
def test_vcf_encode_overwrite_zarr_confirm_yes (self , mocked , tmp_path , response ):
202
202
icf_path = tmp_path / "icf"
203
203
icf_path .mkdir ()
@@ -218,7 +218,7 @@ def test_vcf_encode_overwrite_zarr_confirm_yes(self, mocked, tmp_path, response)
218
218
)
219
219
220
220
@pytest .mark .parametrize ("force_arg" , ["-f" , "--force" ])
221
- @mock .patch ("bio2zarr.icf .explode" )
221
+ @mock .patch ("bio2zarr.vcf .explode" )
222
222
def test_vcf_explode_overwrite_icf_force (self , mocked , tmp_path , force_arg ):
223
223
icf_path = tmp_path / "icf"
224
224
icf_path .mkdir ()
@@ -236,7 +236,7 @@ def test_vcf_explode_overwrite_icf_force(self, mocked, tmp_path, force_arg):
236
236
)
237
237
238
238
@pytest .mark .parametrize ("force_arg" , ["-f" , "--force" ])
239
- @mock .patch ("bio2zarr.icf .encode" )
239
+ @mock .patch ("bio2zarr.vcf .encode" )
240
240
def test_vcf_encode_overwrite_icf_force (self , mocked , tmp_path , force_arg ):
241
241
icf_path = tmp_path / "icf"
242
242
icf_path .mkdir ()
@@ -257,7 +257,7 @@ def test_vcf_encode_overwrite_icf_force(self, mocked, tmp_path, force_arg):
257
257
** DEFAULT_ENCODE_ARGS ,
258
258
)
259
259
260
- @mock .patch ("bio2zarr.icf .explode" )
260
+ @mock .patch ("bio2zarr.vcf .explode" )
261
261
def test_vcf_explode_missing_vcf (self , mocked , tmp_path ):
262
262
icf_path = tmp_path / "icf"
263
263
runner = ct .CliRunner (mix_stderr = False )
@@ -272,7 +272,7 @@ def test_vcf_explode_missing_vcf(self, mocked, tmp_path):
272
272
mocked .assert_not_called ()
273
273
274
274
@pytest .mark .parametrize ("response" , ["n" , "N" , "No" ])
275
- @mock .patch ("bio2zarr.icf .explode" )
275
+ @mock .patch ("bio2zarr.vcf .explode" )
276
276
def test_vcf_explode_overwrite_icf_confirm_no (self , mocked , tmp_path , response ):
277
277
icf_path = tmp_path / "icf"
278
278
icf_path .mkdir ()
@@ -287,7 +287,7 @@ def test_vcf_explode_overwrite_icf_confirm_no(self, mocked, tmp_path, response):
287
287
assert "Aborted" in result .stderr
288
288
mocked .assert_not_called ()
289
289
290
- @mock .patch ("bio2zarr.icf .explode" )
290
+ @mock .patch ("bio2zarr.vcf .explode" )
291
291
def test_vcf_explode_missing_and_existing_vcf (self , mocked , tmp_path ):
292
292
icf_path = tmp_path / "icf"
293
293
runner = ct .CliRunner (mix_stderr = False )
@@ -302,7 +302,7 @@ def test_vcf_explode_missing_and_existing_vcf(self, mocked, tmp_path):
302
302
mocked .assert_not_called ()
303
303
304
304
@pytest .mark .parametrize (("progress" , "flag" ), [(True , "-P" ), (False , "-Q" )])
305
- @mock .patch ("bio2zarr.icf .explode_init" , return_value = FakeWorkSummary (5 ))
305
+ @mock .patch ("bio2zarr.vcf .explode_init" , return_value = FakeWorkSummary (5 ))
306
306
def test_vcf_dexplode_init (self , mocked , tmp_path , progress , flag ):
307
307
runner = ct .CliRunner (mix_stderr = False )
308
308
icf_path = tmp_path / "icf"
@@ -324,7 +324,7 @@ def test_vcf_dexplode_init(self, mocked, tmp_path, progress, flag):
324
324
)
325
325
326
326
@pytest .mark .parametrize ("num_partitions" , ["-1" , "0" , "asdf" , "1.112" ])
327
- @mock .patch ("bio2zarr.icf .explode_init" , return_value = 5 )
327
+ @mock .patch ("bio2zarr.vcf .explode_init" , return_value = 5 )
328
328
def test_vcf_dexplode_init_bad_num_partitions (
329
329
self , mocked , tmp_path , num_partitions
330
330
):
@@ -339,7 +339,7 @@ def test_vcf_dexplode_init_bad_num_partitions(
339
339
assert "Invalid value for '-n'" in result .stderr
340
340
mocked .assert_not_called ()
341
341
342
- @mock .patch ("bio2zarr.icf .explode_init" , return_value = 5 )
342
+ @mock .patch ("bio2zarr.vcf .explode_init" , return_value = 5 )
343
343
def test_vcf_dexplode_init_no_partitions (self , mocked , tmp_path ):
344
344
runner = ct .CliRunner (mix_stderr = False )
345
345
icf_path = tmp_path / "icf"
@@ -352,7 +352,7 @@ def test_vcf_dexplode_init_no_partitions(self, mocked, tmp_path):
352
352
assert "-n/--num-partitions must currently be specified" in result .stderr
353
353
mocked .assert_not_called ()
354
354
355
- @mock .patch ("bio2zarr.icf .explode_partition" )
355
+ @mock .patch ("bio2zarr.vcf .explode_partition" )
356
356
def test_vcf_dexplode_partition (self , mocked , tmp_path ):
357
357
runner = ct .CliRunner (mix_stderr = False )
358
358
icf_path = tmp_path / "icf"
@@ -369,7 +369,7 @@ def test_vcf_dexplode_partition(self, mocked, tmp_path):
369
369
str (icf_path ), 1 , ** DEFAULT_DEXPLODE_PARTITION_ARGS
370
370
)
371
371
372
- @mock .patch ("bio2zarr.icf .explode_partition" )
372
+ @mock .patch ("bio2zarr.vcf .explode_partition" )
373
373
def test_vcf_dexplode_partition_one_based (self , mocked , tmp_path ):
374
374
runner = ct .CliRunner (mix_stderr = False )
375
375
icf_path = tmp_path / "icf"
@@ -386,7 +386,7 @@ def test_vcf_dexplode_partition_one_based(self, mocked, tmp_path):
386
386
str (icf_path ), 0 , ** DEFAULT_DEXPLODE_PARTITION_ARGS
387
387
)
388
388
389
- @mock .patch ("bio2zarr.icf .explode_partition" )
389
+ @mock .patch ("bio2zarr.vcf .explode_partition" )
390
390
def test_vcf_dexplode_partition_missing_dir (self , mocked , tmp_path ):
391
391
runner = ct .CliRunner (mix_stderr = False )
392
392
icf_path = tmp_path / "icf"
@@ -401,7 +401,7 @@ def test_vcf_dexplode_partition_missing_dir(self, mocked, tmp_path):
401
401
mocked .assert_not_called ()
402
402
403
403
@pytest .mark .parametrize ("partition" , ["-- -1" , "asdf" , "1.112" ])
404
- @mock .patch ("bio2zarr.icf .explode_partition" )
404
+ @mock .patch ("bio2zarr.vcf .explode_partition" )
405
405
def test_vcf_dexplode_partition_bad_partition (self , mocked , tmp_path , partition ):
406
406
runner = ct .CliRunner (mix_stderr = False )
407
407
icf_path = tmp_path / "icf"
@@ -416,7 +416,7 @@ def test_vcf_dexplode_partition_bad_partition(self, mocked, tmp_path, partition)
416
416
assert len (result .stdout ) == 0
417
417
mocked .assert_not_called ()
418
418
419
- @mock .patch ("bio2zarr.icf .explode_finalise" )
419
+ @mock .patch ("bio2zarr.vcf .explode_finalise" )
420
420
def test_vcf_dexplode_finalise (self , mocked , tmp_path ):
421
421
runner = ct .CliRunner (mix_stderr = False )
422
422
result = runner .invoke (
@@ -427,7 +427,7 @@ def test_vcf_dexplode_finalise(self, mocked, tmp_path):
427
427
assert len (result .stderr ) == 0
428
428
mocked .assert_called_once_with (str (tmp_path ))
429
429
430
- @mock .patch ("bio2zarr.icf .inspect" )
430
+ @mock .patch ("bio2zarr.vcf .inspect" )
431
431
def test_inspect (self , mocked , tmp_path ):
432
432
runner = ct .CliRunner (mix_stderr = False )
433
433
result = runner .invoke (
@@ -438,7 +438,7 @@ def test_inspect(self, mocked, tmp_path):
438
438
assert len (result .stderr ) == 0
439
439
mocked .assert_called_once_with (str (tmp_path ))
440
440
441
- @mock .patch ("bio2zarr.icf .mkschema" )
441
+ @mock .patch ("bio2zarr.vcf .mkschema" )
442
442
def test_mkschema (self , mocked , tmp_path ):
443
443
runner = ct .CliRunner (mix_stderr = False )
444
444
result = runner .invoke (
@@ -455,7 +455,7 @@ def test_mkschema(self, mocked, tmp_path):
455
455
mocked .assert_called_once ()
456
456
457
457
@pytest .mark .parametrize (("progress" , "flag" ), [(True , "-P" ), (False , "-Q" )])
458
- @mock .patch ("bio2zarr.icf .encode" )
458
+ @mock .patch ("bio2zarr.vcf .encode" )
459
459
def test_encode (self , mocked , tmp_path , progress , flag ):
460
460
icf_path = tmp_path / "icf"
461
461
icf_path .mkdir ()
@@ -478,7 +478,7 @@ def test_encode(self, mocked, tmp_path, progress, flag):
478
478
)
479
479
480
480
@pytest .mark .parametrize (("progress" , "flag" ), [(True , "-P" ), (False , "-Q" )])
481
- @mock .patch ("bio2zarr.icf .encode_init" , return_value = FakeWorkSummary (10 ))
481
+ @mock .patch ("bio2zarr.vcf .encode_init" , return_value = FakeWorkSummary (10 ))
482
482
def test_dencode_init (self , mocked , tmp_path , progress , flag ):
483
483
icf_path = tmp_path / "icf"
484
484
icf_path .mkdir ()
@@ -501,7 +501,7 @@ def test_dencode_init(self, mocked, tmp_path, progress, flag):
501
501
** args ,
502
502
)
503
503
504
- @mock .patch ("bio2zarr.icf .encode_init" , return_value = 5 )
504
+ @mock .patch ("bio2zarr.vcf .encode_init" , return_value = 5 )
505
505
def test_vcf_dencode_init_no_partitions (self , mocked , tmp_path ):
506
506
runner = ct .CliRunner (mix_stderr = False )
507
507
icf_path = tmp_path / "icf"
@@ -516,7 +516,7 @@ def test_vcf_dencode_init_no_partitions(self, mocked, tmp_path):
516
516
assert "-n/--num-partitions must currently be specified" in result .stderr
517
517
mocked .assert_not_called ()
518
518
519
- @mock .patch ("bio2zarr.icf .encode_partition" )
519
+ @mock .patch ("bio2zarr.vcf .encode_partition" )
520
520
def test_vcf_dencode_partition (self , mocked , tmp_path ):
521
521
runner = ct .CliRunner (mix_stderr = False )
522
522
zarr_path = tmp_path / "zarr"
@@ -533,7 +533,7 @@ def test_vcf_dencode_partition(self, mocked, tmp_path):
533
533
str (zarr_path ), 1 , ** DEFAULT_DENCODE_PARTITION_ARGS
534
534
)
535
535
536
- @mock .patch ("bio2zarr.icf .encode_partition" )
536
+ @mock .patch ("bio2zarr.vcf .encode_partition" )
537
537
def test_vcf_dencode_partition_one_based (self , mocked , tmp_path ):
538
538
runner = ct .CliRunner (mix_stderr = False )
539
539
zarr_path = tmp_path / "zarr"
@@ -551,7 +551,7 @@ def test_vcf_dencode_partition_one_based(self, mocked, tmp_path):
551
551
)
552
552
553
553
@pytest .mark .parametrize (("progress" , "flag" ), [(True , "-P" ), (False , "-Q" )])
554
- @mock .patch ("bio2zarr.icf .encode_finalise" )
554
+ @mock .patch ("bio2zarr.vcf .encode_finalise" )
555
555
def test_vcf_dencode_finalise (self , mocked , tmp_path , progress , flag ):
556
556
runner = ct .CliRunner (mix_stderr = False )
557
557
result = runner .invoke (
@@ -567,7 +567,7 @@ def test_vcf_dencode_finalise(self, mocked, tmp_path, progress, flag):
567
567
mocked .assert_called_once_with (str (tmp_path ), ** args )
568
568
569
569
@pytest .mark .parametrize (("progress" , "flag" ), [(True , "-P" ), (False , "-Q" )])
570
- @mock .patch ("bio2zarr.icf .convert" )
570
+ @mock .patch ("bio2zarr.vcf .convert" )
571
571
def test_convert_vcf (self , mocked , progress , flag ):
572
572
runner = ct .CliRunner (mix_stderr = False )
573
573
result = runner .invoke (
@@ -587,7 +587,7 @@ def test_convert_vcf(self, mocked, progress, flag):
587
587
)
588
588
589
589
@pytest .mark .parametrize ("response" , ["n" , "N" , "No" ])
590
- @mock .patch ("bio2zarr.icf .convert" )
590
+ @mock .patch ("bio2zarr.vcf .convert" )
591
591
def test_vcf_convert_overwrite_zarr_confirm_no (self , mocked , tmp_path , response ):
592
592
zarr_path = tmp_path / "zarr"
593
593
zarr_path .mkdir ()
@@ -617,7 +617,7 @@ def test_convert_plink(self, mocked, progress, flag):
617
617
mocked .assert_called_once_with ("in" , "out" , ** args )
618
618
619
619
@pytest .mark .parametrize ("response" , ["y" , "Y" , "yes" ])
620
- @mock .patch ("bio2zarr.icf .convert" )
620
+ @mock .patch ("bio2zarr.vcf .convert" )
621
621
def test_vcf_convert_overwrite_zarr_confirm_yes (self , mocked , tmp_path , response ):
622
622
zarr_path = tmp_path / "zarr"
623
623
zarr_path .mkdir ()
0 commit comments