Skip to content

Commit

Permalink
Update limits tests to locally new options format
Browse files Browse the repository at this point in the history
  • Loading branch information
chesslogic committed Nov 17, 2024
1 parent 37a0816 commit fa401ac
Showing 1 changed file with 53 additions and 47 deletions.
100 changes: 53 additions & 47 deletions worlds/checksmate/test/TestPieceLimits.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from worlds.checksmate import CMWorld, Options



# I don't like that this generates many entire seeds just to check some global logic.
# TODO(chesslogic): find_piece_limit should accept an army option value. Store piece distribution on some other helper

Expand Down Expand Up @@ -47,13 +46,14 @@ def test_no_options(self) -> None:


class TestChaosPieceLimitsOfVanilla(PieceLimitTestBase):
options = {
"fairy_chess_army": "chaos",
"fairy_chess_piece_collection": 2,
"minor_piece_limit_by_type": 2,
"major_piece_limit_by_type": 2,
"queen_piece_limit_by_type": 1,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["fairy_chess_army"] = "chaos"
self.options["fairy_chess_piece"] = Options.FairyChessPieces.option_full
self.options["minor_piece_limit_by_type"] = 2
self.options["major_piece_limit_by_type"] = 2
self.options["queen_piece_limit_by_type"] = 1
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 22
Expand All @@ -64,13 +64,14 @@ def test_limit(self) -> None:


class TestChaosPieceLimitsOfOne(PieceLimitTestBase):
options = {
"fairy_chess_army": "chaos",
"fairy_chess_piece_collection": "configure",
"minor_piece_limit_by_type": 1,
"major_piece_limit_by_type": 1,
"queen_piece_limit_by_type": 1,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["fairy_chess_army"] = "chaos"
self.options["fairy_chess_piece"] = Options.FairyChessPieces.option_full
self.options["minor_piece_limit_by_type"] = 1
self.options["major_piece_limit_by_type"] = 1
self.options["queen_piece_limit_by_type"] = 1
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 11
Expand All @@ -81,13 +82,14 @@ def test_limit(self) -> None:


class TestChaosPieceLimitsOfTwo(PieceLimitTestBase):
options = {
"fairy_chess_army": "chaos",
"fairy_chess_piece_collection": "configure",
"minor_piece_limit_by_type": 2,
"major_piece_limit_by_type": 2,
"queen_piece_limit_by_type": 2,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["fairy_chess_army"] = "chaos"
self.options["fairy_chess_piece"] = Options.FairyChessPieces.option_full
self.options["minor_piece_limit_by_type"] = 2
self.options["major_piece_limit_by_type"] = 2
self.options["queen_piece_limit_by_type"] = 2
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 22
Expand All @@ -98,13 +100,14 @@ def test_limit(self) -> None:


class TestChaosPieceLimitsByVariety(PieceLimitTestBase):
options = {
"fairy_chess_army": "chaos",
"fairy_chess_piece_collection": "configure",
"minor_piece_limit_by_type": 5,
"major_piece_limit_by_type": 1,
"queen_piece_limit_by_type": 3,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["fairy_chess_army"] = "chaos"
self.options["fairy_chess_piece"] = Options.FairyChessPieces.option_full
self.options["minor_piece_limit_by_type"] = 5
self.options["major_piece_limit_by_type"] = 1
self.options["queen_piece_limit_by_type"] = 3
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 55
Expand All @@ -115,9 +118,9 @@ def test_limit(self) -> None:


class TestStablePieceLimits(PieceLimitTestBase):
options = {
"fairy_chess_piece_collection": "configure",
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["fairy_chess_pieces"] = Options.FairyChessPieces.option_full

def test_no_options(self) -> None:
expected_minors = 0
Expand All @@ -127,11 +130,12 @@ def test_no_options(self) -> None:


class TestStablePieceLimitsOfVanilla(PieceLimitTestBase):
options = {
"minor_piece_limit_by_type": 2,
"major_piece_limit_by_type": 2,
"queen_piece_limit_by_type": 1,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["minor_piece_limit_by_type"] = 2
self.options["major_piece_limit_by_type"] = 2
self.options["queen_piece_limit_by_type"] = 1
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 4
Expand All @@ -142,11 +146,12 @@ def test_limit(self) -> None:


class TestStablePieceLimitsOfThree(PieceLimitTestBase):
options = {
"minor_piece_limit_by_type": 3,
"major_piece_limit_by_type": 3,
"queen_piece_limit_by_type": 3,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["minor_piece_limit_by_type"] = 3
self.options["major_piece_limit_by_type"] = 3
self.options["queen_piece_limit_by_type"] = 3
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 6
Expand All @@ -157,11 +162,12 @@ def test_limit(self) -> None:


class TestStablePieceLimitsByVariety(PieceLimitTestBase):
options = {
"minor_piece_limit_by_type": 4,
"major_piece_limit_by_type": 2,
"queen_piece_limit_by_type": 3,
}
def world_setup(self, *args, **kwargs) -> None:
self.options = copy(self.options)
self.options["minor_piece_limit_by_type"] = 4
self.options["major_piece_limit_by_type"] = 2
self.options["queen_piece_limit_by_type"] = 3
super().world_setup(*args, **kwargs)

def test_limit(self) -> None:
expected_minors = 8
Expand Down

0 comments on commit fa401ac

Please sign in to comment.