def test_reset(self): ''' test method reset() ''' shoe = Shoe(8) self.assertTrue(shoe.cut_card_seen(), "new shoe cut card 0") shoe.set_cut_card(1) self.assertFalse(shoe.cut_card_seen(), "new cut card 1") shoe.reset() self.assertTrue(shoe.cut_card_seen(), "after reset back to 0")
def test_shuffle(self): ''' test method shuffle() ''' shoe = Shoe(8) self.assertEqual("Ac", str(shoe.deal()), "no shuffle Ace clubs first") shoe.reset() expected_clubs = "Ac2c3c4c5c6c7c8c9cTcJcQcKc" cards = "" for _ in range(13): cards += str(shoe.deal()) self.assertEqual(expected_clubs, cards, "pre-shuffle") shoe.shuffle() cards = "" for _ in range(13): cards += str(shoe.deal()) self.assertNotEqual(expected_clubs, cards, "post-shuffle")