Beispiel #1
0
 def test_start_game(self):
     game = Game.create_game()
     game.start()
     player = game.player
     dealer = game.dealer
     self.assertEqual(2, len(player.hand.cards),
                      'The player should be dealt 2 cards')
     self.assertEqual(1, len(dealer.hand.cards),
                      'The dealer should be dealt 1 card')
Beispiel #2
0
 def test_card_pool_creation(self):
     expected_card_pool = [
         Card(1, SUIT_SPADES),
         Card(2, SUIT_SPADES),
     ]
     with patch('blackjack.game.generate_deck',
                autospec=True,
                return_value=expected_card_pool):
         game = Game.create_game()
         self.assertCountEqual(expected_card_pool, game.card_pool)