You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
737 B
34 lines
737 B
|
|
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)
|
|
|
|
|
|
def test_normal_source():
|
|
info = MediaInfo()
|
|
info.general = {
|
|
|
|
}
|
|
info.video = {
|
|
"Width": 1920,
|
|
"Height": 1080,
|
|
"DisplayAspectRatio": 1.778
|
|
}
|
|
info.determine_aspect_properties()
|
|
|
|
assert info.resolution == Resolution(1920, 1080)
|
|
assert info.pixel_aspect_ratio == Ratio(1, 1)
|