예제 #1
0
def test_ffmpeg(tmpdir):
    path = tmpdir.join('test2').relto('')
    m = Movie(dt=1.0 / 14, height_ratio=2)
    img = np.arange(100).reshape(4, 5, 5)
    m.add_image(img, style='dark_img')
    m.save(path)
    assert os.path.isfile(path + '.mp4')
예제 #2
0
def test_imagemagick(tmpdir):
    path = tmpdir.join('test').relto('')
    m = Movie(dt=1.0 / 14, height_ratio=2)
    img = np.arange(100).reshape(4, 5, 5)
    m.add_image(img, style='dark_img')
    m.save(path, writer_name='imagemagick')
    assert os.path.isfile(path + '.gif')
예제 #3
0
def test_save_fail(tmpdir):
    path = tmpdir.join('test').relto('')
    writers.avail = []
    m = Movie(dt=1.0 / 14, height_ratio=2)
    img = np.arange(100).reshape(4, 5, 5)
    m.add_image(img, style='dark_img')
    with pytest.raises(ValueError) as ex:
        m.save(path)
    assert 'Could not find' in str(ex.value)