2023-09-30 00:53:45 +02:00
|
|
|
"""Test camera user and password cleanup."""
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
2023-12-03 15:16:01 +01:00
|
|
|
from frigate.output.birdseye import get_canvas_shape
|
2023-09-30 00:53:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestBirdseye(unittest.TestCase):
|
|
|
|
def test_16x9(self):
|
|
|
|
"""Test 16x9 aspect ratio works as expected for birdseye."""
|
|
|
|
width = 1280
|
|
|
|
height = 720
|
|
|
|
canvas_width, canvas_height = get_canvas_shape(width, height)
|
|
|
|
assert canvas_width == width
|
|
|
|
assert canvas_height == height
|
|
|
|
|
|
|
|
def test_4x3(self):
|
|
|
|
"""Test 4x3 aspect ratio works as expected for birdseye."""
|
|
|
|
width = 1280
|
|
|
|
height = 960
|
|
|
|
canvas_width, canvas_height = get_canvas_shape(width, height)
|
|
|
|
assert canvas_width == width
|
|
|
|
assert canvas_height == height
|
|
|
|
|
|
|
|
def test_32x9(self):
|
|
|
|
"""Test 32x9 aspect ratio works as expected for birdseye."""
|
|
|
|
width = 2560
|
|
|
|
height = 720
|
|
|
|
canvas_width, canvas_height = get_canvas_shape(width, height)
|
|
|
|
assert canvas_width == width
|
|
|
|
assert canvas_height == height
|
|
|
|
|
|
|
|
def test_9x16(self):
|
|
|
|
"""Test 9x16 aspect ratio works as expected for birdseye."""
|
|
|
|
width = 720
|
|
|
|
height = 1280
|
|
|
|
canvas_width, canvas_height = get_canvas_shape(width, height)
|
|
|
|
assert canvas_width == width
|
|
|
|
assert canvas_height == height
|
|
|
|
|
|
|
|
def test_non_16x9(self):
|
|
|
|
"""Test non 16x9 aspect ratio fails for birdseye."""
|
|
|
|
width = 1280
|
|
|
|
height = 840
|
|
|
|
canvas_width, canvas_height = get_canvas_shape(width, height)
|
|
|
|
assert canvas_width == width # width will be the same
|
|
|
|
assert canvas_height != height
|