| 1 | import sys |
| 2 | import unittest |
| 3 | from pathlib import Path |
| 4 | |
| 5 | sys.path.insert(0, str(Path(__file__).parent.parent.parent)) |
| 6 | |
| 7 | from app.models.schema import VideoAspect |
| 8 | |
| 9 | |
| 10 | class TestVideoAspect(unittest.TestCase): |
| 11 | def test_to_resolution_known_aspects(self): |
| 12 | self.assertEqual(VideoAspect.landscape.to_resolution(), (1920, 1080)) |
| 13 | self.assertEqual(VideoAspect.portrait.to_resolution(), (1080, 1920)) |
| 14 | self.assertEqual(VideoAspect.square.to_resolution(), (1080, 1080)) |
| 15 | |
| 16 | def test_to_resolution_rejects_unsupported_value(self): |
| 17 | with self.assertRaises(ValueError): |
| 18 | VideoAspect.to_resolution("4:5") |
| 19 | |
| 20 | |
| 21 | if __name__ == "__main__": |
| 22 | unittest.main() |
| 23 |