def test_encode_cin_invalid_arguments(self): with self.assertRaises(ValueError): codicefiscale.encode_cin(None) with self.assertRaises(ValueError): codicefiscale.encode_cin('CCCFBA85D03')
def test_encode_cin(self): data = [ { 'input': 'CCCFBA85D03L219', 'result': 'P', }, ] for obj in data: # with self.subTest(obj=obj): self.assertEqual(codicefiscale.encode_cin(obj['input']), obj['result'])