Example #1
0
    def test_mock_play_1(self):
        g = sorry.game()
        s1 = sorry.strategy(g)
        s2 = sorry.strategy(g)
        p1 = sorry.player("Bob", "YELLOW", s1)
        p2 = sorry.player("Joe", "GREEN", s2)
        s1.set_player(p1)
        s2.set_player(p2)
        card = sorry.card1()

        for i in xrange(160):
            s1.apply(card)
            s2.apply(card)

        self.assertTrue(p1.is_win())
        self.assertTrue(p2.is_win())
Example #2
0
    def test_mock_play_2(self):
        g = sorry.game()
        s1 = sorry.strategy(g)
        s2 = sorry.strategy(g)
        p1 = sorry.player("Bob", "YELLOW", s1)
        p2 = sorry.player("Joe", "GREEN", s2)
        s1.set_player(p1)
        s2.set_player(p2)
        card = sorry.card2()

        for i in xrange(28):
            s1.apply(card)
            s2.apply(card)

        self.assertEqual(p1.pawns[0].position, 166)
        self.assertEqual(p2.pawns[0].position, 181)
Example #3
0
    def test_mock_play_7(self):
        g = sorry.game()
        s1 = sorry.strategy(g)
        s2 = sorry.strategy(g)
        p1 = sorry.player("Bob", "YELLOW", s1)
        p2 = sorry.player("Joe", "GREEN", s2)
        s1.set_player(p1)
        s2.set_player(p2)
        card = sorry.card7()
        card_out = sorry.card1()

        for i in xrange(11):
            if not self.avaliable_pawns(p1.pawns):
                s1.apply(card_out)
                s2.apply(card_out)
                continue
            s1.apply(card)
            s2.apply(card)

        self.assertEqual(p1.pawns[0].position, 163)
        self.assertEqual(p2.pawns[0].position, 178)
Example #4
0
    def test_mock_play_5(self):
        g = sorry.game()
        s1 = sorry.strategy(g)
        s2 = sorry.strategy(g)
        p1 = sorry.player("Bob", "YELLOW", s1)
        p2 = sorry.player("Joe", "GREEN", s2)
        s1.set_player(p1)
        s2.set_player(p2)
        card = sorry.card5()
        card_out = sorry.card1()

        for i in xrange(56):
            if not self.avaliable_pawns(p1.pawns):
                s1.apply(card_out)
                s2.apply(card_out)
                continue
            s1.apply(card)
            s2.apply(card)

        self.assertTrue(p1.is_win())
        self.assertTrue(p2.is_win())
Example #5
0
 def setUp(self):
     self.g = sorry.game()
     self.s = sorry.strategy(self.g)
     self.p = sorry.player("Bob", "YELLOW", self.s)
     self.s.set_player(self.p)