Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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_image | |||
|
|||
|
|||
class TestVideoImage(ExtTestCase): | |||
|
|||
def test_video_image(self): | |||
fLOG( | |||
__file__, | |||
self._testMethodName, | |||
OutputPrint=__name__ == "__main__") | |||
temp = get_temp_folder(__file__, "temp_video_image") | |||
img = os.path.join(temp, '..', 'data', 'GastonLagaffe_1121.jpg') | |||
vid = video_image(img, duration=60) | |||
exp = os.path.join(temp, "courte2x.mp4") | |||
video_save(vid, exp, fps=20) | |||
self.assertExists(exp) | |||
|
|||
|
|||
if __name__ == "__main__": | |||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters