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()
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)