Skip to content

Commit

Permalink
[Black Jack]: Some spacing and consistency fixes in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Metallifax authored and BethanyG committed Feb 19, 2022
1 parent 6abd10d commit 67e9fdd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions exercises/concept/black-jack/black_jack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def test_value_of_ace(self):

self.assertEqual(value_of_ace(card_one, card_two), ace_value, msg=error_msg)


@pytest.mark.task(taskno=4)
def test_is_blackjack(self):
data = [
Expand All @@ -70,10 +69,9 @@ def test_is_blackjack(self):

for variant, (hand, blackjack) in enumerate(data, 1):
with self.subTest(f'variation #{variant}', input=hand, output=blackjack):
error_msg=f'Hand {hand} {"is" if blackjack else "is not"} a blackjack.'

self.assertEqual( is_blackjack(*hand), blackjack, msg=error_msg)
error_msg = f'Hand {hand} {"is" if blackjack else "is not"} a blackjack.'

self.assertEqual(is_blackjack(*hand), blackjack, msg=error_msg)

@pytest.mark.task(taskno=5)
def test_can_split_pairs(self):
Expand All @@ -83,11 +81,10 @@ def test_can_split_pairs(self):

for variant, (hand, split_pairs) in enumerate(data, 1):
with self.subTest(f'variation #{variant}', input=hand, output=split_pairs):
error_msg=f'Hand {hand} {"can" if split_pairs else "cannot"} be split into pairs.'
error_msg = f'Hand {hand} {"can" if split_pairs else "cannot"} be split into pairs.'

self.assertEqual(can_split_pairs(*hand), split_pairs, msg=error_msg)


@pytest.mark.task(taskno=6)
def test_can_double_down(self):
data = [
Expand Down

0 comments on commit 67e9fdd

Please sign in to comment.