Permalink
Browse files

better cleaning

  • Loading branch information...
sdpython committed Jan 21, 2018
1 parent 93fd664 commit b3065a5a57f7a3d02fc31eb3d14278f4dbe5c4d2
Showing with 14 additions and 9 deletions.
  1. +14 −9 _unittests/ut_art/test_video_noenv3_image.py
@@ -57,26 +57,29 @@ def test_video_image_position(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_video_position")
img = os.path.join(temp, '..', 'data', 'GastonLagaffe_1121.jpg')
vid = img = video_image(img, duration=60, zoom=(200, 200))
nimg = os.path.join(temp, '..', 'data', 'GastonLagaffe_1121.jpg')
img = video_image(nimg, duration=60, zoom=(200, 200))
exp = os.path.join(temp, "courte.mp4")
video_save(vid, exp, fps=20)
video_save(img, exp, fps=20)
self.assertExists(exp)
clean_video(vid)
clean_video(img)
exp = os.path.join(temp, "courte05.mp4")
img = video_image(nimg, duration=60, zoom=(200, 200))
vid = video_position(img, (0.5, 0.5), relative=True)
video_save(vid, exp, fps=20)
self.assertExists(exp)
clean_video(vid)
clean_video([vid, img])
exp = os.path.join(temp, "courtecb.mp4")
img = video_image(nimg, duration=60, zoom=(200, 200))
vid = video_position(img, ('center', 'bottom'), relative=True)
video_save(vid, exp, fps=20)
self.assertExists(exp)
clean_video(vid)
clean_video([vid, img])
exp = os.path.join(temp, "courtefct.mp4")
img = video_image(nimg, duration=60, zoom=(200, 200))
vid = video_position(img, lambda t: (t * 0.1, t * 0.2), relative=True)
video_save(vid, exp, fps=20)
self.assertExists(exp)
@@ -88,20 +91,22 @@ def test_video_image_resize(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_video_resize")
img = os.path.join(temp, '..', 'data', 'GastonLagaffe_1121.jpg')
vid = img = video_image(img, duration=60, zoom=(200, 200))
nimg = os.path.join(temp, '..', 'data', 'GastonLagaffe_1121.jpg')
vid = video_image(nimg, duration=60, zoom=(200, 200))
exp = os.path.join(temp, "courte.mp4")
video_save(vid, exp, fps=20)
self.assertExists(exp)
clean_video(vid)
exp = os.path.join(temp, "courtecb.mp4")
img = video_image(nimg, duration=60, zoom=(200, 200))
vid = video_resize(img, 0.5)
video_save(vid, exp, fps=20)
self.assertExists(exp)
clean_video(vid)
clean_video([vid, img])
exp = os.path.join(temp, "courtefct.mp4")
img = video_image(nimg, duration=60, zoom=(200, 200))
vid = video_resize(img, lambda t: max(0.1, 1 - 0.1 * t))
video_save(vid, exp, fps=20)
self.assertExists(exp)

0 comments on commit b3065a5

Please sign in to comment.