@@ -26,6 +26,63 @@ def test_vcf_explode(self, mocked):
26
26
show_progress = True ,
27
27
)
28
28
29
+ def test_vcf_explode_init (self ):
30
+ runner = ct .CliRunner (mix_stderr = False )
31
+ with mock .patch ("bio2zarr.vcf.explode_init" ) as mocked :
32
+ result = runner .invoke (
33
+ cli .vcf2zarr , ["explode-init" , "source" , "dest" , "-n" , "5" ], catch_exceptions = False
34
+ )
35
+ assert result .exit_code == 0
36
+ assert len (result .stdout ) == 0
37
+ assert len (result .stderr ) == 0
38
+ mocked .assert_called_once_with (
39
+ ("source" ,),
40
+ "dest" ,
41
+ target_num_partitions = 5 ,
42
+ worker_processes = 1 ,
43
+ show_progress = True ,
44
+ )
45
+
46
+ def test_vcf_explode_partition_count (self ):
47
+ runner = ct .CliRunner (mix_stderr = False )
48
+ with mock .patch ("bio2zarr.vcf.explode_partition_count" , return_value = 5 ) as mocked :
49
+ result = runner .invoke (
50
+ cli .vcf2zarr , ["explode-partition-count" , "path" ], catch_exceptions = False
51
+ )
52
+ assert result .exit_code == 0
53
+ assert result .stdout == "5\n "
54
+ assert len (result .stderr ) == 0
55
+ mocked .assert_called_once_with ("path" )
56
+
57
+ def test_vcf_explode_slice (self ):
58
+ runner = ct .CliRunner (mix_stderr = False )
59
+ with mock .patch ("bio2zarr.vcf.explode_slice" ) as mocked :
60
+ result = runner .invoke (
61
+ cli .vcf2zarr , ["explode-slice" , "path" , "-s" , "1" , "-e" , "2" ], catch_exceptions = False
62
+ )
63
+ assert result .exit_code == 0
64
+ assert len (result .stdout ) == 0
65
+ assert len (result .stderr ) == 0
66
+ mocked .assert_called_once_with (
67
+ "path" ,
68
+ 1 ,
69
+ 2 ,
70
+ column_chunk_size = 64 ,
71
+ worker_processes = 1 ,
72
+ show_progress = True ,
73
+ )
74
+
75
+ def test_vcf_explode_finalise (self ):
76
+ runner = ct .CliRunner (mix_stderr = False )
77
+ with mock .patch ("bio2zarr.vcf.explode_finalise" ) as mocked :
78
+ result = runner .invoke (
79
+ cli .vcf2zarr , ["explode-finalise" , "path" ], catch_exceptions = False
80
+ )
81
+ assert result .exit_code == 0
82
+ assert len (result .stdout ) == 0
83
+ assert len (result .stderr ) == 0
84
+ mocked .assert_called_once_with ("path" )
85
+
29
86
@mock .patch ("bio2zarr.vcf.inspect" )
30
87
def test_inspect (self , mocked ):
31
88
runner = ct .CliRunner (mix_stderr = False )
0 commit comments