예제 #1
0
 def testValidate(self):
     self.assertEqual(
         validate('12345'),
         {Group(n, 1) for n in [1, 2, 3, 4, 5]}
     )
     self.assertEqual(
         validate('12121'),
         {Group(1, 3), Group(2, 2)}
     )
예제 #2
0
 def testValidadateBadCharRaises(self):
     with self.assertRaises(ValueError):
         validate('1234a')
     with self.assertRaises(ValueError):
         validate('12340')
     with self.assertRaises(ValueError):
         validate('12347')
예제 #3
0
 def testValidateTooLongRaises(self):
     with self.assertRaises(ValueError):
         validate('1234')