Permalink
Browse files

split unit test

  • Loading branch information...
sdpython committed Jan 2, 2018
1 parent 16ea91a commit 7345fa6520f8356b7569deb89494a7a322110e37
Showing with 69 additions and 13 deletions.
  1. +1 −13 _unittests/ut_faq/test_video_noenv1.py
  2. +68 −0 _unittests/ut_faq/test_video_noenv1_modif.py
@@ -46,7 +46,7 @@
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase
from src.code_beatrix.faq.faq_video import video_save, video_extract_video, video_compose, video_concatenate, video_modification
from src.code_beatrix.faq.faq_video import video_save, video_extract_video, video_compose, video_concatenate
class TestVideo(ExtTestCase):
@@ -83,18 +83,6 @@ def test_compose_avideo(self):
video_save(vid3, exp)
self.assertExists(exp)
def test_modify_avideo(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_video_modification")
vid = os.path.join(temp, '..', 'data', 'videxa.mp4')
vid2 = video_modification(vid, speed=2., mirrory=True, mirrorx=True)
exp = os.path.join(temp, "courte2x.mp4")
video_save(vid2, exp)
self.assertExists(exp)
if __name__ == "__main__":
unittest.main()
@@ -0,0 +1,68 @@
# -*- coding: utf-8 -*-
"""
@brief test log(time=1000s)
Duraction is around a few seconds but the test needs to be run
at the end of the series of unitests as it interferes
with the notebook unittesting (it uses Popen too).
"""
import sys
import os
import unittest
try:
import pyquickhelper
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..",
"..",
"pyquickhelper",
"src")))
if path not in sys.path:
sys.path.append(path)
import pyquickhelper
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not in sys.path:
sys.path.append(path)
import src
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase
from src.code_beatrix.faq.faq_video import video_save, video_modification
class TestVideoModif(ExtTestCase):
def test_modify_avideo(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_video_modification")
vid = os.path.join(temp, '..', 'data', 'videxa.mp4')
vid2 = video_modification(vid, speed=2., mirrory=True, mirrorx=True)
exp = os.path.join(temp, "courte2x.mp4")
video_save(vid2, exp)
self.assertExists(exp)
if __name__ == "__main__":
unittest.main()

0 comments on commit 7345fa6

Please sign in to comment.