Ejemplo n.º 1
0
 def test_valid_luhn(self):
     """
     Tests if the number has a valid check digit
     Example from wiki https://en.wikipedia.org/wiki/Luhn_algorithm
     """
     assert luhn_checksum("79927398713") == 0
Ejemplo n.º 2
0
 def test_invalid_luhn(self):
     """
     Tests a number with an invalid check digit
     Example from wiki https://en.wikipedia.org/wiki/Luhn_algorithm
     """
     assert luhn_checksum("79927398714") != 0
Ejemplo n.º 3
0
 def test_valid_luhn(self):
     for aadhaar_id in self.aadhaar_ids:
         assert luhn_checksum(aadhaar_id) == 0