diff --git a/tests/data/test_nospeech_video.mp4 b/tests/data/test_nospeech_video.mp4 new file mode 100644 index 0000000..f64f31a Binary files /dev/null and b/tests/data/test_nospeech_video.mp4 differ diff --git a/tests/test_openlrc.py b/tests/test_openlrc.py index e502fd4..b14a4ce 100644 --- a/tests/test_openlrc.py +++ b/tests/test_openlrc.py @@ -31,6 +31,7 @@ class TestLRCer(unittest.TestCase): def setUp(self) -> None: self.audio_path = Path('data/test_audio.wav') self.video_path = Path('data/test_video.mp4') + self.nospeech_video_path = Path('data/test_nospeech_video.mp4') def tearDown(self) -> None: def clear_paths(input_path): @@ -78,6 +79,11 @@ def test_video_file_transcription_translation(self): result = lrcer.run('data/test_video.mp4') self.assertTrue(result) + def test_nospeech_video_file_transcription_translation(self): + lrcer = LRCer(whisper_model='tiny', device='cpu', compute_type='default') + result = lrcer.run('data/test_nospeech_video.mp4') + self.assertTrue(result) + @patch('openlrc.translate.LLMTranslator.translate', MagicMock(side_effect=Exception('test exception'))) def test_translation_error(self): lrcer = LRCer(whisper_model='tiny', device='cpu', compute_type='default')