def setUp(self): d = self.deck = test_setup.TestDeck() self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players # p1 leads Craftsman, p2 thinks self.p1.hand.set_content([d.jack0, d.latrine0]) self.p1.clientele.set_content([d.dock0]) self.game.in_town_sites = ['Stone', 'Stone'] a = message.GameAction(message.THINKERORLEAD, False) self.game.handle(a) a = message.GameAction(message.LEADROLE, 'Craftsman', 1, d.jack0) self.game.handle(a) a = message.GameAction(message.FOLLOWROLE, 0) self.game.handle(a) a = message.GameAction(message.THINKERTYPE, True) self.game.handle(a) self.assertEqual(self.game.role_led, 'Craftsman') self.assertEqual(self.game.turn_number, 1) self.assertTrue(self.game.oot_allowed) a = message.GameAction(message.CRAFTSMAN, d.latrine0, None, 'Rubble') self.game.handle(a)
def test_limit_with_influence(self): """Test limit with some completed buildings. """ g = test_setup.simple_two_player() p1, p2 = g.players p1.influence = ['Stone'] p2.influence = ['Rubble'] self.assertEqual(g._clientele_limit(p1), 5) self.assertEqual(g._clientele_limit(p2), 3) p1.influence = ['Wood'] p2.influence = ['Marble'] self.assertEqual(g._clientele_limit(p1), 3) self.assertEqual(g._clientele_limit(p2), 5) p1.influence = ['Brick'] p2.influence = ['Concrete'] self.assertEqual(g._clientele_limit(p1), 4) self.assertEqual(g._clientele_limit(p2), 4) p1.influence = ['Brick', 'Concrete', 'Marble'] p2.influence = ['Concrete', 'Stone', 'Rubble', 'Rubble', 'Rubble'] self.assertEqual(g._clientele_limit(p1), 9) self.assertEqual(g._clientele_limit(p2), 10)
def setUp(self): d = self.deck = test_setup.TestDeck() self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players # p1 leads Legionary, p2 thinks self.p1.hand.set_content([d.jack0, d.latrine0]) a = message.GameAction(message.THINKERORLEAD, False) self.game.handle(a) a = message.GameAction(message.LEADROLE, 'Legionary', 1, d.jack0) self.game.handle(a) a = message.GameAction(message.FOLLOWROLE, 0) self.game.handle(a) a = message.GameAction(message.THINKERTYPE, True) self.game.handle(a) self.assertEqual(self.game.role_led, 'Legionary') self.assertEqual(self.game.turn_number, 1) a = message.GameAction(message.LEGIONARY, d.latrine0) self.game.handle(a) self.assertEqual(self.game.legionary_count, 1) self.assertEqual(self.game.legionary_player_index, 0) a = message.GameAction(message.TAKEPOOLCARDS) self.game.handle(a) a = message.GameAction(message.GIVECARDS) self.game.handle(a)
def setUp(self): """ This is run prior to every test. """ self.deck = test_setup.TestDeck() self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players # Indicate that we want to lead a = message.GameAction(message.THINKERORLEAD, False) self.game.handle(a)
def test_initial_limit(self): """Test limit at beginning of game. """ g = test_setup.simple_two_player() p1, p2 = g.players self.assertEqual(g._clientele_limit(p1), 2) self.assertEqual(g._clientele_limit(p2), 2)
def setUp(self): """ This is run prior to every test. """ self.deck = TestDeck() self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players a = message.GameAction(message.THINKERORLEAD, True) self.game.handle(a) self.assertEqual(self.game.expected_action, message.THINKERTYPE)
def setUp(self): """ This is run prior to every test. """ d = self.deck = test_setup.TestDeck() self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players # Indicate that p1 will lead a = message.GameAction(message.THINKERORLEAD, False) self.game.handle(a) self.p1.hand.set_content([d.jack0]) # p1 leads Laborer a = message.GameAction(message.LEADROLE, 'Laborer', 1, d.jack0) self.game.handle(a)
def test_limit_with_aqueduct(self): """Test limit with completed Aqueduct. """ d = TestDeck() g = test_setup.simple_two_player() p1, p2 = g.players self.assertEqual(g._clientele_limit(p1), 2) p1.buildings.append(Building(d.aqueduct, 'Concrete', complete=True)) self.assertEqual(g._clientele_limit(p1), 4) p1.influence = ['Stone'] self.assertEqual(g._clientele_limit(p1), 10)
def test_limit_with_insula(self): """Test limit with completed Insula. """ d = TestDeck() g = test_setup.simple_two_player() p1, p2 = g.players self.assertEqual(g._clientele_limit(p1), 2) p1.buildings.append(Building(d.insula, 'Rubble', complete=True)) self.assertEqual(g._clientele_limit(p1), 4) p1.influence = ['Stone'] self.assertEqual(g._clientele_limit(p1), 7)
def setUp(self): """ This is run prior to every test. """ self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players
def setUp(self): self.deck = d = TestDeck() self.game = test_setup.simple_two_player() self.p1, self.p2 = self.game.players