Beispiel #1
0
 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")
Beispiel #2
0
 def test_cut_card_seen(self):
     '''!
     test method cut_card_seen()
     '''
     shoe = Shoe(8)
     self.assertTrue(shoe.cut_card_seen(), "new shoe, yes")
     shoe.set_cut_card(1)
     self.assertFalse(shoe.cut_card_seen(), "position 1 no deal, no")
     card1 = shoe.deal()
     self.assertTrue(shoe.cut_card_seen(), "after 1 dealt, then yes")
Beispiel #3
0
 def test_set_cut_card(self):
     '''
     test method set_cut_card(int)
     '''
     # good test
     shoe = Shoe(8)
     shoe.set_cut_card(-14)
     # bad test
     # too big
     expected = "cut card position value too big"
     try:
         shoe.set_cut_card(987)
         self.fail("expected failure set_cut_card(987)")
     except Exception as ex:
         self.assertEqual(expected, str(ex), "too big")
     # too small
     expected = "cut card position value too small"
     try:
         shoe.set_cut_card(-987)
         self.fail("expected failure set_cut_card(-987)")
     except Exception as ex:
         self.assertEqual(expected, str(ex), "too small")