feat(sides): Side enum with opposite/from_str

This commit is contained in:
ai-chess
2026-05-14 23:03:29 +03:00
parent c02b43abbf
commit 5fcb620ac2
2 changed files with 36 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
from ai_chess.sides import Side
def test_opposite():
assert Side.WHITE.opposite() is Side.BLACK
assert Side.BLACK.opposite() is Side.WHITE
def test_from_str():
assert Side.from_str("white") is Side.WHITE
assert Side.from_str("black") is Side.BLACK
def test_str_value():
assert Side.WHITE.value == "white"
assert Side.BLACK.value == "black"