Beispiel #1
0
    def test_available_actions_during_play(self):
        game = Game([])

        self.assertEqual((
            game.ACTION_HIT,
            game.ACTION_STAND,
        ), game.get_available_actions())
Beispiel #2
0
    def test_available_actions_at_end_of_game(self):
        # Player has won.
        game = Game([])

        game.player.add_card(Card(1, SUIT_SPADES))
        game.player.add_card(Card(13, SUIT_SPADES))

        self.assertEqual((), game.get_available_actions())

        # Player has gone bust.
        game = Game([])

        game.player.add_card(Card(10, SUIT_SPADES))
        game.player.add_card(Card(10, SUIT_SPADES))
        game.player.add_card(Card(10, SUIT_SPADES))

        self.assertEqual((), game.get_available_actions())