Skip to content

Commit

Permalink
Issue Zulko#596 and Zulko#598: Updated test to support close().
Browse files Browse the repository at this point in the history
Also changed test to meet Issue Zulko#598, but that is also being done in
PR#585, so will require a merge.
  • Loading branch information
Julian-O committed Jul 1, 2017
1 parent ff38df9 commit c4d8e40
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_TextClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import pytest
from moviepy.video.fx.blink import blink
from moviepy.video.VideoClip import TextClip
from test_helper import TMP_DIR, TRAVIS

sys.path.append("tests")
from test_helper import TMP_DIR, TRAVIS

def test_duration():
#TextClip returns the following error under Travis (issue with Imagemagick)
Expand All @@ -15,26 +15,28 @@ def test_duration():
return

clip = TextClip('hello world', size=(1280,720), color='white')
clip.set_duration(5)
clip = clip.set_duration(5) # Changed due to #598.
assert clip.duration == 5
clip.close()

clip2 = clip.fx(blink, d_on=1, d_off=1)
clip2.set_duration(5)
clip2 = clip2.set_duration(5)
assert clip2.duration == 5
clip2.close()

# Moved from tests.py. Maybe we can remove these?
def test_if_textclip_crashes_in_caption_mode():
if TRAVIS:
return

TextClip(txt='foo', color='white', size=(640, 480), method='caption',
align='center', fontsize=25)
align='center', fontsize=25).close()

def test_if_textclip_crashes_in_label_mode():
if TRAVIS:
return

TextClip(txt='foo', method='label')
TextClip(txt='foo', method='label').close()

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

0 comments on commit c4d8e40

Please sign in to comment.