From 728e5d28340c3f69a7f77967fa981deda4869f4c Mon Sep 17 00:00:00 2001 From: Alexandru Pisarenco Date: Sat, 9 Jan 2021 03:06:25 +0100 Subject: [PATCH] Unit test for video ratio scaling --- test/__init__.py | 0 test/test_aspect.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/__init__.py create mode 100644 test/test_aspect.py diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_aspect.py b/test/test_aspect.py new file mode 100644 index 0000000..f19afa9 --- /dev/null +++ b/test/test_aspect.py @@ -0,0 +1,17 @@ + +from minfo import MediaInfo, Ratio, Resolution + +def test_square_source(): + info = MediaInfo() + info.general = { + + } + info.video = { + "Width": 576, + "Height": 576, + "DisplayAspectRatio": 1.778 + } + info.determine_aspect_properties() + + assert info.resolution == Resolution(576, 576) + assert info.pixel_aspect_ratio == Ratio(16, 9)