Ejemplo n.º 1
0
    def test_Rabble(self):
        tu.print_test_header("test Rabble")
        rabble = prosperity.Rabble(self.game, self.player1)
        copper = supply_cards.Copper(self.game, self.player2)
        estate = supply_cards.Estate(self.game, self.player2)

        self.player2.deck.append(estate)
        self.player2.deck.append(copper)
        self.player2.deck.append(estate)

        duchy = supply_cards.Duchy(self.game, self.player3)
        gardens = base.Gardens(self.game, self.player3)
        great_hall = intrigue.Great_Hall(self.game, self.player3)

        self.player3.deck.append(duchy)
        self.player3.deck.append(gardens)
        self.player3.deck.append(great_hall)

        rabble.play()
        topdeck1 = self.player2.topdeck()
        topdeck2 = self.player2.topdeck()
        self.assertTrue(topdeck1.title == "Estate")
        self.assertTrue(topdeck2.title == "Estate")
        yield tu.send_input(self.player3, "post_selection",
                            ["Gardens", "Duchy"])

        topdeck1 = self.player3.topdeck()
        topdeck2 = self.player3.topdeck()

        self.assertTrue(topdeck1.title == "Duchy")
        self.assertTrue(topdeck2.title == "Gardens")
Ejemplo n.º 2
0
	def test_Great_Hall(self):
		tu.print_test_header("test Great Hall")
		great_hall = intrigue.Great_Hall(self.game, self.player1)
		player1_vp = self.player1.total_vp()
		self.player1.hand.add(great_hall)
		great_hall.play()
		self.assertTrue((self.player1.actions == 1))
		self.assertTrue((self.player1.total_vp()) == player1_vp + 1)
Ejemplo n.º 3
0
    def test_Silk_Road(self):
        tu.print_test_header("test Silk Road")
        silk_road = hl.Silk_Road(self.game, self.player1)
        harem = intrigue.Harem(self.game, self.player1)
        great_hall = intrigue.Great_Hall(self.game, self.player1)
        nobles = intrigue.Nobles(self.game, self.player1)
        gardens = base.Gardens(self.game, self.player1)

        self.player1.hand.add(silk_road)
        self.player1.discard_pile.append(harem)
        self.player1.deck.append(great_hall)

        self.assertTrue(silk_road.get_vp() == 1)

        self.player1.hand.add(gardens)
        self.player1.hand.add(nobles)

        self.assertTrue(silk_road.get_vp() == 2)
Ejemplo n.º 4
0
	def test_Tribute(self):
		tu.print_test_header("test Tribute")
		tribute = intrigue.Tribute(self.game, self.player1)
		tu.add_many_to_hand(self.player1, tribute, 2)
		copper = supply_cards.Copper(self.game, self.player2)
		great_hall = intrigue.Great_Hall(self.game, self.player2)
		swindler = intrigue.Swindler(self.game, self.player2)

		self.player2.deck.append(copper)
		self.player2.deck.append(copper)
		self.player2.deck.append(great_hall)
		self.player2.deck.append(swindler)

		cards_in_hand = len(self.player1.hand.card_array())
		tribute.play()
		self.assertTrue(self.player1.actions == 4)
		self.assertTrue(len(self.player2.discard_pile) == 2)

		tribute.play()
		self.assertTrue(self.player1.balance == 2)
Ejemplo n.º 5
0
	def test_Scout(self):
		tu.print_test_header("test Scout")
		scout = intrigue.Scout(self.game, self.player1)
		scout2 = intrigue.Scout(self.game, self.player1)
		province = supply_cards.Province(self.game, self.player1)
		greathall = intrigue.Great_Hall(self.game, self.player1)
		silver = supply_cards.Silver(self.game, self.player1)
		self.player1.hand.add(scout)
		self.player1.deck.append(province)
		self.player1.deck.append(greathall)
		self.player1.deck.append(scout2)
		self.player1.deck.append(silver)
		decklength = len(self.player1.deck)
		scout.play()

		self.assertTrue(greathall.title in self.player1.hand)
		self.assertTrue(province.title in self.player1.hand)
		self.assertFalse(silver.title in self.player1.hand)
		self.assertFalse(scout2.title in self.player1.hand)
		yield tu.send_input(self.player1, "post_selection", ["Scout", "Silver"])
		self.assertTrue(self.player1.deck[-1].title == "Silver")
		self.assertTrue(self.player1.deck[-2].title == "Scout")
		#decksize should be 2 less since we took province and great hall out
		self.assertTrue(len(self.player1.deck) == decklength - 2)