Example #1
0
async def test_end_active_player_turn_no_zombies():
    gs = GameState()
    gs.players = [PlayerShelter(), PlayerShelter(), PlayerShelter()]
    survivor_card = CityCard(ZombieType.ZOMBIE)
    survivor_card.flip()
    for player in gs.players:
        player.survivors.append(survivor_card)
    gs.active_player = gs.players[2]
    gs.supply_deck = [Supply.AXE, Supply.ALARM, Supply.AXE, Supply.GUN]
    await gs.end_active_player_turn()
    assert gs.active_player == gs.players[0]
    assert len(gs.players[2].supplies) == 3
Example #2
0
async def test_end_active_player_turn_zombies_no_obstacles():
    gs = GameState()
    gs.players = [PlayerShelter(), PlayerShelter(), PlayerShelter()]
    survivor_card = CityCard(ZombieType.ZOMBIE)
    survivor_card.flip()
    for player in gs.players:
        player.survivors.append(survivor_card)
    gs.active_player = gs.players[2]
    gs.active_player.print = dumper_factory()
    gs.active_player.supplies = [Supply.AXE, Supply.ALARM]
    zombie_card = CityCard(ZombieType.ZOMBIE)
    zombie_card.flip()
    gs.active_player.zombies = [zombie_card]
    gs.supply_deck = [Supply.AXE, Supply.ALARM, Supply.AXE, Supply.GUN]
    await gs.end_active_player_turn()
    assert gs.active_player == gs.players[0]
    assert len(gs.players[2].supplies) == 0
    assert len(tests.common.outputs) == 2
Example #3
0
async def test_end_active_player_turn_zombies_and_alarm(
        fast_zombie, zombie, big_zombie):
    gs = GameState()
    gs.players = [PlayerShelter(), PlayerShelter(), PlayerShelter()]
    survivor_card = CityCard(ZombieType.ZOMBIE)
    for player in gs.players:
        player.survivors.append(survivor_card)
    survivor_card.flip()
    gs.city_deck.append(survivor_card)
    gs.supply_deck = [Supply.AXE, Supply.ALARM, Supply.AXE, Supply.GUN]
    gs.active_player = gs.players[2]
    shelter = gs.active_player
    shelter.obstacles = [Supply.ALARM, Supply.ALARM]
    shelter.zombies = [fast_zombie, zombie, big_zombie]
    shelter.print = dumper_factory()
    shelter.input = helper_factory(['y'])
    await gs.end_active_player_turn()
    assert len(shelter.survivors) == 1
    assert len(shelter.zombies) == 4
    assert len(gs.city_deck) == 0
    assert len(shelter.obstacles) == 1
    assert len(gs.supply_graveyard) == 1
    assert len(shelter.supplies) == 3
    assert len(tests.common.outputs) == 7
Example #4
0
def fast_zombie():
    ret = CityCard(ZombieType.FAST)
    ret.flip()
    return ret
Example #5
0
def big_zombie():
    ret = CityCard(ZombieType.BIG)
    ret.flip()
    return ret
Example #6
0
def zombie():
    ret = CityCard(ZombieType.ZOMBIE)
    ret.flip()
    return ret