import unittest
from unittest.mock import Mock, patch, MagicMock
from app.black_jack.deck.deck import Deck


class TestDeck(unittest.TestCase):

    def test_deck_must_return_three_cards(self):
        cards = [Mock(), Mock(), Mock()]
        deck = Deck(cards)
        self.assertEqual(len(deck.get_cards()), 3)

    @patch('app.black_jack.deck.deck.random')
    def test_shuffle_deck(self, random_mock):
        cards = [Mock(), Mock(), Mock()]
        random_mock.shuffle = MagicMock()
        deck = Deck(cards)
        deck.shuffle()
        random_mock.shuffle.assert_called_once_with(cards)

    def test_deck_should_return_one_card(self):
        cards = ['A', 'Q', 'J']
        deck = Deck(cards)
        one_card = deck.put_card()
        self.assertEqual(len(deck.get_cards()), 2)
        self.assertEqual(len(one_card), 1)

d478c3be0de12a9b01968a26f929d0da5dc593a7
<mask token>


class TestDeck(unittest.TestCase):

    def test_deck_must_return_three_cards(self):
        cards = [Mock(), Mock(), Mock()]
        deck = Deck(cards)
        self.assertEqual(len(deck.get_cards()), 3)
    <mask token>
    <mask token>

<mask token>


class TestDeck(unittest.TestCase):

    def test_deck_must_return_three_cards(self):
        cards = [Mock(), Mock(), Mock()]
        deck = Deck(cards)
        self.assertEqual(len(deck.get_cards()), 3)
    <mask token>

    def test_deck_should_return_one_card(self):
        cards = ['A', 'Q', 'J']
        deck = Deck(cards)
        one_card = deck.put_card()
        self.assertEqual(len(deck.get_cards()), 2)
        self.assertEqual(len(one_card), 1)

<mask token>


class TestDeck(unittest.TestCase):

    def test_deck_must_return_three_cards(self):
        cards = [Mock(), Mock(), Mock()]
        deck = Deck(cards)
        self.assertEqual(len(deck.get_cards()), 3)

    @patch('app.black_jack.deck.deck.random')
    def test_shuffle_deck(self, random_mock):
        cards = [Mock(), Mock(), Mock()]
        random_mock.shuffle = MagicMock()
        deck = Deck(cards)
        deck.shuffle()
        random_mock.shuffle.assert_called_once_with(cards)

    def test_deck_should_return_one_card(self):
        cards = ['A', 'Q', 'J']
        deck = Deck(cards)
        one_card = deck.put_card()
        self.assertEqual(len(deck.get_cards()), 2)
        self.assertEqual(len(one_card), 1)

import unittest
from unittest.mock import Mock, patch, MagicMock
from app.black_jack.deck.deck import Deck


class TestDeck(unittest.TestCase):

    def test_deck_must_return_three_cards(self):
        cards = [Mock(), Mock(), Mock()]
        deck = Deck(cards)
        self.assertEqual(len(deck.get_cards()), 3)

    @patch('app.black_jack.deck.deck.random')
    def test_shuffle_deck(self, random_mock):
        cards = [Mock(), Mock(), Mock()]
        random_mock.shuffle = MagicMock()
        deck = Deck(cards)
        deck.shuffle()
        random_mock.shuffle.assert_called_once_with(cards)

    def test_deck_should_return_one_card(self):
        cards = ['A', 'Q', 'J']
        deck = Deck(cards)
        one_card = deck.put_card()
        self.assertEqual(len(deck.get_cards()), 2)
        self.assertEqual(len(one_card), 1)
