Esempio n. 1
0
 def test_exception_4(self):
     cases = [
         (ModulusWeight('', '', 'MOD11',
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1],
                        '4'), '000000', '00000009', True),
         (ModulusWeight('', '', 'MOD11',
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1],
                        '4'), '000000', '00000011', False),
     ]
     for case in cases:
         self.assertEqual(_run_check(case[1], case[2], case[0]), case[3])
Esempio n. 2
0
 def test_exception_3(self):
     cases = [
         (ModulusWeight('', '', 'DBLAL',
                        [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
                        '3'), '499273', '12645678', True),
         (ModulusWeight('', '', 'DBLAL',
                        [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
                        '3'), '499273', '12945671', True),
     ]
     for case in cases:
         self.assertEqual(_run_check(case[1], case[2], case[0]), case[3])
Esempio n. 3
0
 def test_mod10(self):
     cases = [
         (ModulusWeight('', '', 'MOD10',
                        [0, 0, 0, 0, 0, 0, 7, 1, 3, 7, 1, 3, 7, 1],
                        None), '080211', '11111111', True),
         (ModulusWeight('', '', 'MOD10',
                        [0, 0, 0, 0, 0, 0, 7, 1, 3, 7, 1, 3, 7, 1],
                        None), '080211', '11111112', False),
     ]
     for case in cases:
         self.assertEqual(_run_check(case[1], case[2], case[0]), case[3])
Esempio n. 4
0
 def test_mod11(self):
     cases = [
         (ModulusWeight('', '', 'MOD11',
                        [0, 0, 0, 0, 0, 0, 7, 5, 8, 3, 4, 6, 2, 1],
                        None), '000000', '58177632', True),
         (ModulusWeight('', '', 'MOD11',
                        [0, 0, 0, 0, 0, 0, 7, 5, 8, 3, 4, 6, 2, 1],
                        None), '000000', '58177633', False),
     ]
     for case in cases:
         self.assertEqual(_run_check(case[1], case[2], case[0]), case[3])
Esempio n. 5
0
 def test_dbla(self):
     cases = [
         (ModulusWeight('', '', 'DBLAL',
                        [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
                        None), '499273', '12345678', True),
         (ModulusWeight('', '', 'DBLAL',
                        [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
                        None), '499273', '12345679', False),
     ]
     for case in cases:
         self.assertEqual(_run_check(case[1], case[2], case[0]), case[3])