예제 #1
0
    def test_next(self):
        d = Deck()
        d.deal(5)
        c = d.next()

        self.assertEqual(c.playerId, 0)

        for i in xrange(108 - 5 * 7 - 2):
            d.next()
예제 #2
0
    def test_reshuffle(self):
        d = Deck()
        d.deal(5)

        fc = [c for c in d.cards if c.status == 0]

        self.assertEqual(len(fc), 108 - 35)

        for i in xrange(108 - 35):
            c = d.next()
            c.status = 2

        fc = [c for c in d.cards if c.status == 0]

        self.assertEqual(len(fc), 0)

        d.reshuffle()

        fc = [c for c in d.cards if c.status == 0]

        self.assertEqual(len(fc), 108 - 35)