def test_doudizhu_new_game(self): cards_group = doudizhu.new_game() self.assertEqual(len(cards_group[0]), 17) self.assertEqual(len(cards_group[1]), 17) self.assertEqual(len(cards_group[2]), 17) self.assertEqual(len(cards_group[3]), 3) total = sum([len(cg) for cg in cards_group]) self.assertEqual(total, 54) print '' for card_ints in cards_group: Card.print_pretty_cards(card_ints)
from doudizhu import Card, new_game cards_groups = new_game() cards_groups for cards_group in cards_groups: Card.print_pretty_cards(cards_group)