MCPcopy
hub / github.com/facefusion/facefusion / test_replace_audio

Function test_replace_audio

tests/test_ffmpeg.py:164–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162
163
164def test_replace_audio() -> None:
165 test_set =\
166 [
167 (get_test_example_file('target-240p-16khz.avi'), get_test_output_file('target-240p-16khz.avi')),
168 (get_test_example_file('target-240p-16khz.m4v'), get_test_output_file('target-240p-16khz.m4v')),
169 (get_test_example_file('target-240p-16khz.mkv'), get_test_output_file('target-240p-16khz.mkv')),
170 (get_test_example_file('target-240p-16khz.mov'), get_test_output_file('target-240p-16khz.mov')),
171 (get_test_example_file('target-240p-16khz.mp4'), get_test_output_file('target-240p-16khz.mp4')),
172 (get_test_example_file('target-240p-48khz.mp4'), get_test_output_file('target-240p-48khz.mp4')),
173 (get_test_example_file('target-240p-16khz.webm'), get_test_output_file('target-240p-16khz.webm'))
174 ]
175 output_audio_encoders = get_available_encoder_set().get('audio')
176
177 for target_path, output_path in test_set:
178 create_temp_directory(target_path)
179
180 for output_audio_encoder in output_audio_encoders:
181 state_manager.init_item('output_audio_encoder', output_audio_encoder)
182 copy_file(target_path, get_temp_file_path(target_path))
183
184 assert replace_audio(target_path, get_test_example_file('source.mp3'), output_path) is True
185 assert replace_audio(target_path, get_test_example_file('source.wav'), output_path) is True
186
187 clear_temp_directory(target_path)
188
189 state_manager.init_item('output_audio_encoder', 'aac')

Callers

nothing calls this directly

Calls 8

create_temp_directoryFunction · 0.90
copy_fileFunction · 0.90
get_temp_file_pathFunction · 0.90
replace_audioFunction · 0.90
clear_temp_directoryFunction · 0.90
get_test_example_fileFunction · 0.85
get_test_output_fileFunction · 0.85

Tested by

no test coverage detected