Ejemplo n.º 1
0
 def test_draw(self):
     player = Player('You')
     assert len(player.hold_cards) == 0
     player.draw_card(0)
     assert player.hold_cards == [
         'Spade A',
     ]
     player.draw_card(4)
     assert player.hold_cards == ['Spade A', 'Spade 5']
Ejemplo n.º 2
0
 def test_refresh(self):
     player = Player('You')
     for i in range(3):
         player.draw_card(i)
     assert len(player.hold_cards) == 3
     assert player.get_point() != [
         0,
     ]
     player.refresh()
     assert len(player.hold_cards) == 0
     assert player.get_point() == [
         0,
     ]
Ejemplo n.º 3
0
 def test_get_point(self):
     player = Player('You')
     player.draw_card(0)
     assert player.get_point() == [1, 11]
     player.draw_card(13)
     assert player.get_point() == [
         2,
     ]
     player.draw_card(10)
     player.draw_card(11)
     assert player.get_point() == [
         22,
     ]