diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..cdb50a62b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM python:3 + +# Install numpy using system package manager +RUN apt-get -y update && apt-get -y install libav-tools imagemagick libopencv-dev python-opencv + +# Install some special fonts we use in testing, etc.. +RUN apt-get -y install fonts-liberation + +RUN apt-get install -y locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 + +ENV LC_ALL C.UTF-8 + +# do we need all of these, maybe remove some of them? +RUN pip install imageio numpy scipy matplotlib pandas sympy nose decorator tqdm pillow pytest + +# install scikit-image after the other deps, it doesn't cause errors this way. +RUN pip install scikit-image sklearn + +# install from github since there are bugs in latest versions. +RUN git clone https://github.com/Zulko/moviepy.git /var/src/moviepy +RUN cd /var/src/moviepy/ && python setup.py install + +# install ffmpeg from imageio. +RUN python -c "import imageio; imageio.plugins.ffmpeg.download()" + +# modify ImageMagick policy file so that Textclips work correctly. +RUN cat /etc/ImageMagick-6/policy.xml | sed 's/none/read,write/g'> /etc/ImageMagick-6/policy.xml diff --git a/tests/test_PR.py b/tests/test_PR.py index d4a7bab3c..64e846330 100644 --- a/tests/test_PR.py +++ b/tests/test_PR.py @@ -8,29 +8,41 @@ from moviepy.editor import * +import sys +sys.path.append("tests") +import download_media +from test_helper import PYTHON_VERSION, TMP_DIR, TRAVIS + +def test_download_media(capsys): + with capsys.disabled(): + download_media.download() def test_PR_306(): + if TRAVIS: + return + #put this back in once we get ImageMagick working on travis-ci - #assert TextClip.list('font') != [] - #assert TextClip.list('color') != [] + assert TextClip.list('font') != [] + assert TextClip.list('color') != [] - #with pytest.raises(Exception, message="Expecting Exception"): - # TextClip.list('blah') - pass + with pytest.raises(Exception, message="Expecting Exception"): + TextClip.list('blah') def test_PR_339(): + if TRAVIS: + return + #in caption mode - #overlay = TextClip(txt='foo', - # color='white', - # size=(640, 480), - # method='caption', - # align='center', - # fontsize=25) + overlay = TextClip(txt='foo', + color='white', font="Liberation-Mono", + size=(640, 480), + method='caption', + align='center', + fontsize=25) #in_label_mode - #overlay = TextClip(txt='foo', method='label') - pass + overlay = TextClip(txt='foo', font="Liberation-Mono", method='label') def test_PR_424(): @@ -44,7 +56,8 @@ def test_PR_424(): def test_PR_458(): clip = ColorClip([1000, 600], color=(60, 60, 60), duration=10) - clip.write_videofile("test.mp4", progress_bar=False, fps=30) + clip.write_videofile(os.path.join(TMP_DIR, "test.mp4"), + progress_bar=False, fps=30) def test_PR_515(): diff --git a/tests/test_misc.py b/tests/test_misc.py index 7376166b1..dfeee7cb2 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -31,7 +31,7 @@ def test_subtitles(): if TRAVIS: return - generator = lambda txt: TextClip(txt, font='Georgia-Regular', + generator = lambda txt: TextClip(txt, font='Liberation-Mono', size=(800,600), fontsize=24, method='caption', align='South', color='white')