This commit is contained in:
nose
2025-12-05 03:41:16 -08:00
parent 79d4f1a09e
commit e3747555bf
22 changed files with 3669 additions and 388 deletions

47
tests/test_cube_ui.py Normal file
View File

@@ -0,0 +1,47 @@
import pytest
from tarot.ui import CubeDisplay
from tarot.tarot_api import Tarot
def test_cube_display_init():
cube = Tarot.cube
display = CubeDisplay(cube, "default")
assert display.current_wall_name == "North"
assert display.deck_name == "default"
def test_cube_navigation():
cube = Tarot.cube
display = CubeDisplay(cube)
# North -> Right -> East
display._navigate("Right")
assert display.current_wall_name == "East"
# East -> Up -> Above
display._navigate("Up")
assert display.current_wall_name == "Above"
# Above -> Down -> North
display._navigate("Down")
assert display.current_wall_name == "North"
# North -> Left -> West
display._navigate("Left")
assert display.current_wall_name == "West"
def test_find_card_for_direction():
cube = Tarot.cube
display = CubeDisplay(cube)
# North Wall, Center Direction -> Aleph -> The Fool
wall = cube.wall("North")
direction = wall.direction("Center") # Should be Aleph?
# Wait, let's check what Center of North is.
# Actually, let's just mock a direction
from kaballah.cube.attributes import WallDirection
# Aleph -> The Fool
d = WallDirection("Center", "Aleph")
card = display._find_card_for_direction(d)
assert card is not None
assert "Fool" in card.name