From f531685ba843a8b5ca4d930806cf9ab8bf2d9b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 31 Jan 2019 14:57:31 +0100 Subject: [PATCH] Updated unit test for FFmpeg 4 --- tests/test_api/test_file_storage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_api/test_file_storage.py b/tests/test_api/test_file_storage.py index 9d3a8e09..fc1fa0f6 100644 --- a/tests/test_api/test_file_storage.py +++ b/tests/test_api/test_file_storage.py @@ -288,6 +288,7 @@ class VideoDurationTest(AbstractPillarTest): from pathlib import Path with self.app.test_request_context(): + # This MKV file does not have container-level duration information. fname = Path(__file__).with_name('video-tiny.mkv') self.assertEqual(1, file_storage._video_duration_seconds(fname)) @@ -299,4 +300,6 @@ class VideoDurationTest(AbstractPillarTest): with self.app.test_request_context(): fname = Path(__file__).with_name('video-tiny.mp4') - self.assertEqual(2, file_storage._video_duration_seconds(fname)) + # FFmpeg 3.x reports 2 seconds, FFmpeg 4.x reports 1.6 seconds which + # is truncated to 1. + self.assertEqual(1, file_storage._video_duration_seconds(fname))