Files
tarot/tests/test_cube_zoom.py

32 lines
626 B
Python
Raw Normal View History

2025-12-05 03:41:16 -08:00
import pytest
2026-02-11 00:02:35 -08:00
2025-12-05 03:41:16 -08:00
from tarot.tarot_api import Tarot
2026-02-11 00:02:35 -08:00
from tarot.ui import CubeDisplay
2025-12-05 03:41:16 -08:00
def test_cube_zoom():
cube = Tarot.cube
display = CubeDisplay(cube)
assert display.zoom_level == 1.0
2026-02-11 00:02:35 -08:00
2025-12-05 03:41:16 -08:00
display._zoom(1.1)
assert display.zoom_level > 1.0
2026-02-11 00:02:35 -08:00
2025-12-05 03:41:16 -08:00
display._zoom(0.5)
assert display.zoom_level < 1.0
2026-02-11 00:02:35 -08:00
2025-12-05 03:41:16 -08:00
def test_cube_zoom_limits():
cube = Tarot.cube
display = CubeDisplay(cube)
2026-02-11 00:02:35 -08:00
2025-12-05 03:41:16 -08:00
# Test upper limit
for _ in range(20):
display._zoom(1.5)
assert display.zoom_level <= 3.0
2026-02-11 00:02:35 -08:00
2025-12-05 03:41:16 -08:00
# Test lower limit
for _ in range(20):
display._zoom(0.5)
assert display.zoom_level >= 0.5