From ed4adbeb4047758f1944a7cfbedccad5489a1fba Mon Sep 17 00:00:00 2001 From: Billy Earney Date: Mon, 20 Feb 2017 14:47:10 -0600 Subject: [PATCH 1/2] create test for issue #145 --- tests/test_install.py | 10 ---------- tests/test_issues.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 10 deletions(-) delete mode 100644 tests/test_install.py create mode 100644 tests/test_issues.py diff --git a/tests/test_install.py b/tests/test_install.py deleted file mode 100644 index f98f93450..000000000 --- a/tests/test_install.py +++ /dev/null @@ -1,10 +0,0 @@ - - -from moviepy.editor import * - -W,H = (150,180) -color_clips_props = [{ 'color':[0,0,255], - 'init_pos':[] -[0,0,255],[0,255,0],[255,0,0] -red_clip, green_clip, blue_clip = [ColorClip((W,H),color=c) - for c in RED, GREEN, BLUE] diff --git a/tests/test_issues.py b/tests/test_issues.py new file mode 100644 index 000000000..f3b4e4dfe --- /dev/null +++ b/tests/test_issues.py @@ -0,0 +1,36 @@ +""" +Tests meant to be run with pytest +""" + +import sys +import os +import pytest + +from moviepy.editor import * + + +#@pytest.fixture +#def example_video1(): +# pass + +global knights, knights10 + +def download_youtube_video(url, filename): + if not os.path.exists(filename): + print("\nDownloading %s\n" % filename) + download_webfile(url, filename) + print("Downloading complete...\n") + + +def test_download_media(capsys): + with capsys.disabled(): + download_youtube_video("zvCvOC2VwDc", "media/knights.mp4") + + knights=VideoFileClip("media/knights.mp4") + knights10 = knights.subclip(60,70) + + + +def test_issue_145(): + with pytest.raises(Exception, message="Expecting Exception"): + _final = concatenation([knights10], method = 'composite') From 19d4f035038ffd9e415cdc328c757ddec6fb462d Mon Sep 17 00:00:00 2001 From: Billy Earney Date: Tue, 21 Feb 2017 06:54:36 -0600 Subject: [PATCH 2/2] add tests/media to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5b352189b..5342d3994 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ nosetests.xml # JetBrains .idea + +tests/media