Skip to content

Commit

Permalink
Add some tests for VideoFileClip (Zulko#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
bearney74 authored Mar 1, 2017
1 parent 95f26bd commit 9821199
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_VideoFileClip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest
from moviepy.editor import *
import os

def test_setup():
_red = ColorClip((1024,800), col=(255,0,0))
_green = ColorClip((1024,800), col=(0,255,0))
_blue = ColorClip((1024,800), col=(0,0,255))

_red.fps=_green.fps=_blue.fps=30
_video = clips_array([[_red, _green, _blue]]).set_duration(5)
_video.write_videofile("/tmp/test.mp4")

assert os.path.exists("/tmp/test.mp4")

_clip = VideoFileClip("/tmp/test.mp4")
assert _clip.duration == 5
assert _clip.fps == 30
assert _clip.size == [1024*3, 800]

if __name__ == '__main__':
pytest.main()

0 comments on commit 9821199

Please sign in to comment.