def initialize_starting_deck(self): for i in range(5): self.add(Building.GreenBuilding("Tavern", 1)) for i in range(4): self.add(Building.GreenBuilding("Market", 2)) for i in range(3): self.add(Building.GreenBuilding("Merchant's House", 2)) self.add(Building.GreenBuilding("Dock", 3)) self.add(Building.GreenBuilding("Port", 4)) for i in range(2): self.add(Building.GreenBuilding("Town Hall", 5)) for i in range(3): self.add(Building.BlueBuilding("Temple", 1)) self.add(Building.BlueBuilding("Chapel", 2)) self.add(Building.BlueBuilding("Monastery", 3)) for i in range(2): self.add(Building.BlueBuilding("Cathedral", 5)) for i in range(3): self.add(Building.RedBuilding("Sentry Tower", 1)) self.add(Building.RedBuilding("Jail", 2)) self.add(Building.RedBuilding("Warfield", 3)) for i in range(2): self.add(Building.RedBuilding("Stronghold", 5)) for i in range(5): self.add(Building.YellowBuilding("Estate", 3)) for i in range(4): self.add(Building.YellowBuilding("Castle", 4)) for i in range(3): self.add(Building.YellowBuilding("Palace", 5)) self.add(Building.PurpleBuilding("University", 6)) self.add(Building.PurpleBuilding("Dragon's Gate", 6))
def setUp(self): self.starting_deck = [ Building.GreenBuilding("Tavern", 1), Building.YellowBuilding("Estate", 3), Building.BlueBuilding("Temple", 1), Building.RedBuilding("Jail", 2) ] self.player = Player.Player("Napoleon", self.starting_deck) self.assassin = Role.Assassin() self.thief = Role.Thief() self.mage = Role.Mage() self.king = Role.King() self.bishop = Role.Bishop() self.merchant = Role.Merchant() self.architect = Role.Architect() self.warlord = Role.Warlord() self.roles = [ self.assassin, self.thief, self.mage, self.king, self.bishop, self.merchant, self.architect, self.warlord ]
def test_build_too_expensive(self): too_expensive_building = Building.RedBuilding('Warfield', 3) self.player.take_card(too_expensive_building) self.assertEqual(self.player.build_building(too_expensive_building), False)
def test_start_player_turn_take_card(self): self.player.take_card(Building.RedBuilding('Warfield', 3)) self.assertEqual(len(self.player.get_hand_deck()), 5)