Пример #1
0
    def test_encode_cin_invalid_arguments(self):

        with self.assertRaises(ValueError):
            codicefiscale.encode_cin(None)

        with self.assertRaises(ValueError):
            codicefiscale.encode_cin('CCCFBA85D03')
Пример #2
0
    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'])