Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

test: cover null video transition mode

Avnish Uba2a7bec701cae
diff --git a/test/services/test_video.py b/test/services/test_video.py
index 5031c98e..9daf77a6 100644
--- a/test/services/test_video.py
+++ b/test/services/test_video.py
@@ -226,6 +226,34 @@ class TestVideoService(unittest.TestCase):
)
self.assertTrue(fake_audio_clip.reader.closed)
+
+ def test_combine_videos_handles_none_transition_mode(self):
+ """
+ Ensure `combine_videos` safely handles
+ `video_transition_mode=None`.
+ """
+ class _FakeAudioClip:
+ @property
+ def duration(self):
+ return 10.0
+
+ def close(self):
+ pass
+
+ with tempfile.TemporaryDirectory() as temp_dir:
+ combined_video_path = os.path.join(temp_dir, "combined.mp4")
+ audio_file = os.path.join(temp_dir, "audio.mp3")
+
+ with patch.object(vd, "AudioFileClip", return_value=_FakeAudioClip()):
+ # Use empty video_paths to avoid heavy video processing while
+ # still exercising transition mode normalization logic.
+ result = vd.combine_videos(
+ combined_video_path=combined_video_path,
+ video_paths=[],
+ audio_file=audio_file,
+ video_transition_mode=None,
+ )
+ self.assertEqual(result, combined_video_path)
def test_wrap_text(self):
"""test text wrapping function"""