Exemplo n.º 1
0
    def test_value_of_card(self):
        data = [('2', 2), ('5', 5), ('8', 8), ('A', 1), ('10', 10), ('J', 10),
                ('Q', 10), ('K', 10)]

        for variant, (card, value) in enumerate(data, 1):
            with self.subTest(f'variation #{variant}',
                              input=card,
                              output=value):
                error_msg = f'Expected {value} as the value of {card}.'

                self.assertEqual(value_of_card(card), value, msg=error_msg)
Exemplo n.º 2
0
    def test_value_of_card(self):
        data = [
            ("2", 2),
            ("5", 5),
            ("8", 8),
            ("A", 1),
            ("10", 10),
            ("J", 10),
            ("Q", 10),
            ("K", 10),
        ]

        for variant, (card, value) in enumerate(data, 1):
            with self.subTest(f"variation #{variant}", input=card, output=value):
                error_msg = f"Expected {value} as the value of {card}."

                self.assertEqual(value_of_card(card), value, msg=error_msg)