diff --git a/tests/game_master/test_default_game_master.py b/tests/game_master/test_default_game_master.py index 7c1879d..15f8017 100644 --- a/tests/game_master/test_default_game_master.py +++ b/tests/game_master/test_default_game_master.py @@ -265,7 +265,7 @@ def test_DefaultGameMaster_ask_to_vote( llm_config=False, ) master.last_message = mocker.MagicMock(return_value={'content': expected}) - master._clean_name = mocker.MagicMock(side_effect=lambda _: expected) + master._clean_name = mocker.MagicMock(side_effect=lambda _: expected) # type: ignore # noqa player = master.alive_players[0] # execute actual = master.ask_to_vote(player) @@ -367,7 +367,7 @@ def test_DefaultGameMaster_daytime_discussion( llm_config=False, ) expected = {p.name: f'vote_{p.name}' for p in master.alive_players} - master.ask_to_vote = mocker.MagicMock(side_effect=lambda player, *args, **kwargs: expected.get(player.name)) # noqa + master.ask_to_vote = mocker.MagicMock(side_effect=lambda player, *args, **kwargs: expected.get(player.name)) # type: ignore # noqa run_chat_spy = mocker.spy(master, 'run_chat') # execute actual = master.daytime_discussion() @@ -399,7 +399,7 @@ def test_DefaultGameMaster_nighttime_action_with_2_or_more_werewolves( ) expected = {p.name: f'vote_{p.name}' for p in master.alive_players} for player in master.alive_players: - player.act_in_night = mocker.MagicMock(return_value=f'vote_{player.name}') # noqa + player.act_in_night = mocker.MagicMock(return_value=f'vote_{player.name}') # type: ignore # noqa run_chat_spy = mocker.spy(master, 'run_chat') assert len(master.alive_werewolves) == n_werewolves # execute @@ -427,7 +427,7 @@ def test_DefaultGameMaster_nighttime_action_with_1_werewolf( ) expected = {p.name: f'vote_{p.name}' for p in master.alive_players} for player in master.alive_players: - player.act_in_night = mocker.MagicMock(return_value=f'vote_{player.name}') # noqa + player.act_in_night = mocker.MagicMock(return_value=f'vote_{player.name}') # type: ignore # noqa send_spy = mocker.spy(master, 'send') assert len(master.alive_werewolves) == 1 # execute diff --git a/tests/game_player/test_base.py b/tests/game_player/test_base.py index 91dfb49..677eed5 100644 --- a/tests/game_player/test_base.py +++ b/tests/game_player/test_base.py @@ -6,7 +6,7 @@ from werewolf.game_player.knight import Knight from werewolf.game_player.villager import Villager from werewolf.game_player.werewolf import Werewolf -from werewolf.const import ERole, EStatus +from werewolf.const import ERole, ESide, ESideVictoryCondition, EStatus @pytest.mark.parametrize( @@ -49,9 +49,10 @@ def test_BaseWerewolfPlayer_vote(mocker: MockerFixture) -> None: assert player.vote(master) == master.ask_to_vote.return_value -def test_BaseWerewolfPlayer_act_in_night() -> None: +def test_BaseWerewolfPlayer_act_in_night(mocker: MockerFixture) -> None: + master = mocker.MagicMock(IWerewolfGameMaster) player = BaseWerewolfPlayer('name', llm_config=False) - assert player.act_in_night(None) is None + assert player.act_in_night(master) is None def test_BaseWerewolfPlayer_valid() -> None: @@ -59,7 +60,7 @@ def test_BaseWerewolfPlayer_valid() -> None: assert not player.valid() player.role = ERole.Werewolf assert not player.valid() - player.side = ERole.Werewolf + player.side = ESide.Werewolf assert not player.valid() - player.victory_condition = ERole.Werewolf + player.victory_condition = ESideVictoryCondition.WerewolvesWinCondition.value # noqa assert player.valid()