def test_prostitute_prevents_seer(mock_roles, db_session):
    game = WurwolvesGame("test_game")

    wolf_id = uuid()
    seer_id = uuid()
    prostitute_id = uuid()
    villager_id = uuid()

    game.join(wolf_id)
    game.join(seer_id)
    game.join(prostitute_id)
    game.join(villager_id)
    game.join(uuid())
    game.join(uuid())

    game.start_game()

    # Seer checks villager but prostitute sleeps with seer.
    # Wolf kills villager, so villager dies
    game.prostitute_night_action(prostitute_id, seer_id)
    game.seer_night_action(seer_id, villager_id)
    game.wolf_night_action(wolf_id, villager_id)

    assert game.get_player_model(villager_id).state == PlayerState.WOLFED

    summary = get_summary_of_chat(game, seer_id)

    assert re.search(r"you couldn't concentrate", summary)
def test_seer_saved_no_fail(mock_roles, db_session):
    game = WurwolvesGame("test_game")

    wolf_id = uuid()
    medic_id = uuid()
    seer_id = uuid()
    villager_id = uuid()

    game.join(wolf_id)
    game.join(medic_id)
    game.join(seer_id)
    game.join(villager_id)
    game.join(uuid())
    game.join(uuid())

    game.start_game()

    game.seer_night_action(seer_id, wolf_id)
    game.wolf_night_action(wolf_id, seer_id)
    game.medic_night_action(medic_id, seer_id)

    assert game.get_player_model(seer_id).state == PlayerState.ALIVE

    summary = get_summary_of_chat(game, seer_id)

    assert re.search(r"they are a wolf", summary)
def test_miller_works(mock_roles, db_session):
    game = WurwolvesGame("test_game")

    wolf_id = uuid()
    seer_id = uuid()
    miller_id = uuid()
    villager_id = uuid()

    game.join(wolf_id)
    game.join(seer_id)
    game.join(miller_id)
    game.join(villager_id)
    game.join(uuid())
    game.join(uuid())

    game.start_game()
    game.seer_night_action(seer_id, miller_id)
    game.wolf_night_action(wolf_id, villager_id)

    summary = get_summary_of_chat(game, seer_id)

    assert "they are a wolf!" in summary