df
This commit is contained in:
28
tests/test_cube_zoom.py
Normal file
28
tests/test_cube_zoom.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
from tarot.ui import CubeDisplay
|
||||
from tarot.tarot_api import Tarot
|
||||
|
||||
def test_cube_zoom():
|
||||
cube = Tarot.cube
|
||||
display = CubeDisplay(cube)
|
||||
assert display.zoom_level == 1.0
|
||||
|
||||
display._zoom(1.1)
|
||||
assert display.zoom_level > 1.0
|
||||
|
||||
display._zoom(0.5)
|
||||
assert display.zoom_level < 1.0
|
||||
|
||||
def test_cube_zoom_limits():
|
||||
cube = Tarot.cube
|
||||
display = CubeDisplay(cube)
|
||||
|
||||
# Test upper limit
|
||||
for _ in range(20):
|
||||
display._zoom(1.5)
|
||||
assert display.zoom_level <= 3.0
|
||||
|
||||
# Test lower limit
|
||||
for _ in range(20):
|
||||
display._zoom(0.5)
|
||||
assert display.zoom_level >= 0.5
|
||||
Reference in New Issue
Block a user