23 lines
601 B
Python
23 lines
601 B
Python
"""平台目标比例到供应商尺寸参数的映射。"""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
SERVER_DIR = Path(__file__).resolve().parents[1]
|
|
if str(SERVER_DIR) not in sys.path:
|
|
sys.path.insert(0, str(SERVER_DIR))
|
|
|
|
from services.generator import _image_size
|
|
|
|
|
|
class ImageSizeTests(unittest.TestCase):
|
|
def test_pcore_ozon_size_is_exactly_three_to_four(self) -> None:
|
|
width, height = map(int, _image_size("pcore", "3:4").split("x"))
|
|
self.assertEqual(width * 4, height * 3)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|