@@ -20,35 +20,10 @@ def common_expected_args():
20
20
"output_single_stem" : None ,
21
21
"invert_using_spec" : False ,
22
22
"sample_rate" : 44100 ,
23
- "mdx_params" : {
24
- "hop_length" : 1024 ,
25
- "segment_size" : 256 ,
26
- "overlap" : 0.25 ,
27
- "batch_size" : 1 ,
28
- "enable_denoise" : False ,
29
- },
30
- "vr_params" : {
31
- "batch_size" : 4 ,
32
- "window_size" : 512 ,
33
- "aggression" : 5 ,
34
- "enable_tta" : False ,
35
- "enable_post_process" : False ,
36
- "post_process_threshold" : 0.2 ,
37
- "high_end_process" : False ,
38
- },
39
- "demucs_params" : {
40
- "segment_size" : "Default" ,
41
- "shifts" : 2 ,
42
- "overlap" : 0.25 ,
43
- "segments_enabled" : True ,
44
- },
45
- "mdxc_params" : {
46
- "segment_size" : 256 ,
47
- "batch_size" : 1 ,
48
- "overlap" : 8 ,
49
- "override_model_segment_size" : False ,
50
- "pitch_shift" : 0 ,
51
- },
23
+ "mdx_params" : {"hop_length" : 1024 , "segment_size" : 256 , "overlap" : 0.25 , "batch_size" : 1 , "enable_denoise" : False },
24
+ "vr_params" : {"batch_size" : 4 , "window_size" : 512 , "aggression" : 5 , "enable_tta" : False , "enable_post_process" : False , "post_process_threshold" : 0.2 , "high_end_process" : False },
25
+ "demucs_params" : {"segment_size" : "Default" , "shifts" : 2 , "overlap" : 0.25 , "segments_enabled" : True },
26
+ "mdxc_params" : {"segment_size" : 256 , "batch_size" : 1 , "overlap" : 8 , "override_model_segment_size" : False , "pitch_shift" : 0 },
52
27
}
53
28
54
29
@@ -86,14 +61,21 @@ def test_cli_multiple_filenames(capsys):
86
61
87
62
88
63
# Test the CLI with a specific audio file
89
- def test_cli_with_audio_file (capsys ):
90
- test_args = ["cli.py" , "test_audio.mp3" ]
64
+ def test_cli_with_audio_file (capsys , common_expected_args ):
65
+ test_args = ["cli.py" , "test_audio.mp3" , "--model_filename=UVR-MDX-NET-Inst_HQ_4.onnx" ]
91
66
with patch ("audio_separator.separator.Separator.separate" ) as mock_separate :
92
67
mock_separate .return_value = ["output_file.mp3" ]
93
68
with patch ("sys.argv" , test_args ):
94
69
# Call the main function in cli.py
95
70
main ()
96
- # Check if the separate
71
+
72
+ # Update expected args for this specific test
73
+ common_expected_args ["model_file_dir" ] = "/tmp/audio-separator-models/"
74
+
75
+ # Check if the separate method was called with the correct arguments
76
+ mock_separate .assert_called_once ()
77
+
78
+ # Assertions
97
79
assert mock_separate .called
98
80
99
81
0 commit comments