Video editing with Python
Fix tests on videoclip
osaajanidce542315551
diff --git a/tests/test_VideoClip.py b/tests/test_VideoClip.pyindex c6a50983..ec56d894 100644--- a/tests/test_VideoClip.py+++ b/tests/test_VideoClip.py@@ -8,14 +8,8 @@ from PIL import Imageimport pytest-from moviepy.audio.AudioClip import AudioClip-from moviepy.audio.io.AudioFileClip import AudioFileClip+from moviepy import *from moviepy.tools import convert_to_seconds-from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip-from moviepy.video.fx.mask_color import mask_color-from moviepy.video.fx.multiply_speed import multiply_speed-from moviepy.video.io.VideoFileClip import VideoFileClip-from moviepy.video.VideoClip import BitmapClip, ColorClip, ImageClip, VideoClipdef test_aspect_ratio():@@ -181,18 +175,17 @@ def test_write_image_sequence(util, video):assert os.path.isfile(location)-def test_write_gif_imageio(util, video):+def test_write_gif(util, video):clip = video(start_time=0.2, end_time=0.8)location = os.path.join(util.TMP_DIR, "imageio_gif.gif")- clip.write_gif(location, program="imageio")+ clip.write_gif(location)assert os.path.isfile(location)-def test_subfx(util):+def test_with_sub_effetcs(util):clip = VideoFileClip("media/big_buck_bunny_0_30.webm").with_subclip(0, 1)- transform = lambda c: multiply_speed(c, 0.5)- new_clip = clip.subfx(transform, 0.5, 0.8)- location = os.path.join(util.TMP_DIR, "subfx.mp4")+ new_clip = clip.with_sub_effects([vfx.MultiplySpeed(0.5)])+ location = os.path.join(util.TMP_DIR, "with_sub_effects.mp4")new_clip.write_videofile(location)assert os.path.isfile(location)@@ -243,7 +236,7 @@ def test_setaudio_with_audiofile(util):def test_setopacity(util, video):clip = video(start_time=0.2, end_time=0.6)clip = clip.with_opacity(0.5)- clip = clip.on_color(size=(1000, 1000), color=(0, 0, 255), col_opacity=0.8)+ clip = clip.with_on_color(size=(1000, 1000), color=(0, 0, 255), col_opacity=0.8)location = os.path.join(util.TMP_DIR, "setopacity.mp4")clip.write_videofile(location)assert os.path.isfile(location)@@ -260,7 +253,7 @@ def test_with_layer():assert composite_clip.with_subclip(0, 2) == reversed_composite_clip.with_subclip(0, 2)# Make sure that only the 'top' clip is kept- assert top_clip.subclip(0, 2) == composite_clip.with_subclip(0, 2)+ assert top_clip.with_subclip(0, 2) == composite_clip.with_subclip(0, 2)# Make sure that it works even when there is only one clip playing at that timetarget_clip = BitmapClip([["DEF"], ["EFD"], ["CAB"]], fps=1)@@ -384,7 +377,7 @@ def test_videoclip_copy(copy_func):def test_afterimage(util):ai = ImageClip("media/afterimage.png")- masked_clip = mask_color(ai, color=[0, 255, 1]) # for green+ masked_clip = ai.with_effects([vfx.MaskColor(color=[0, 255, 1])]) # for greensome_background_clip = ColorClip((800, 600), color=(255, 255, 255))final_clip = CompositeVideoClip([some_background_clip, masked_clip], use_bgclip=True