We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 273b377 commit efcd4afCopy full SHA for efcd4af
exercises/luhn/luhn_test.py
@@ -5,7 +5,7 @@
5
from luhn import Luhn
6
7
8
-# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
+# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
9
10
class LuhnTest(unittest.TestCase):
11
def test_single_digit_strings_can_not_be_valid(self):
@@ -29,6 +29,9 @@ def test_invalid_Canadian_SIN(self):
29
def test_invalid_credit_card(self):
30
self.assertIs(Luhn("8273 1232 7352 0569").is_valid(), False)
31
32
+ def test_valid_number_with_an_even_number_of_digits(self):
33
+ self.assertIs(Luhn("095 245 88").is_valid(), True)
34
+
35
def test_valid_strings_with_a_non_digit_included_become_invalid(self):
36
self.assertIs(Luhn("055a 444 285").is_valid(), False)
37
0 commit comments