def test_catherine_win(): # Get a game containing Catherine gc, ef, p = helpers.get_game_with_character("Catherine") # Check that Catherine hasn't won initially assert not p.character.win_cond(gc, p) # Check that Catherine wins if she dies first p.setDamage(14, p) assert p.character.win_cond(gc, p) # Check that Catherine does not win if she dies second gc, ef, p = helpers.get_game_with_character("Catherine") h = helpers.get_a_hunter(gc) h.setDamage(14, h) p.setDamage(14, p) assert not p.character.win_cond(gc, p) # Check that Catherine wins if she's in the last two standing gc, ef, p = helpers.get_game_with_character("Catherine", n_players=6) for pl in gc.players: if pl.character.alleg != 1: pl.setDamage(14, pl) assert p.character.win_cond(gc, p)
def test_bob_win(): # Get a game containing Bob gc, ef, p = helpers.get_game_with_character("Bob") # Check that Bob hasn't won initially, or with 4 equips assert not p.character.win_cond(gc, p) p.equipment = ['dummy_equipment'] * 4 assert not p.character.win_cond(gc, p) # Check that Bob wins if we give him 5 equipment cards, or more p.equipment = ['dummy_equipment'] * 5 assert p.character.win_cond(gc, p) p.equipment = ['dummy_equipment'] * 10 assert p.character.win_cond(gc, p)
def test_allie_win(): # Get a game containing Allie gc, ef, p = helpers.get_game_with_character("Allie") # Check that Allie hasn't won if the game isn't over assert not p.character.win_cond(gc, p) # Check that Allie wins if the game is over and she is alive gc.game_over = True assert p.character.win_cond(gc, p) # Check that Allie doesn't win if she's dead p.setDamage(14, p) assert not p.character.win_cond(gc, p)