MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / test_displayHands

Function test_displayHands

tests/test_blackjack.py:79–108  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

77
78
79def test_displayHands(capsys):
80 playerHand = [('A', blackjack.HEARTS), ('K', blackjack.HEARTS)]
81 dealerHand = [('6', blackjack.HEARTS), ('6', blackjack.DIAMONDS)]
82 blackjack.displayHands(playerHand, dealerHand, False)
83 captured = capsys.readouterr()
84 assert captured.out == '\n' + \
85 'DEALER: ???\n' + \
86 ' ___ ___ \n' + \
87 '|## | |6 | \n' + \
88 '|###| | ♦ | \n' + \
89 '|_##| |__6| \n' + \
90 'PLAYER: 21\n' + \
91 ' ___ ___ \n' + \
92 '|A | |K | \n' + \
93 '| ♥ | | ♥ | \n' + \
94 '|__A| |__K| \n'
95
96 blackjack.displayHands(playerHand, dealerHand, True)
97 captured = capsys.readouterr()
98 assert captured.out == '\n' + \
99 'DEALER: 12\n' + \
100 ' ___ ___ \n' + \
101 '|6 | |6 | \n' + \
102 '| ♥ | | ♦ | \n' + \
103 '|__6| |__6| \n' + \
104 'PLAYER: 21\n' + \
105 ' ___ ___ \n' + \
106 '|A | |K | \n' + \
107 '| ♥ | | ♥ | \n' + \
108 '|__A| |__K| \n'
109
110
111def test_getBet():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected