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)} )
def testValidadateBadCharRaises(self): with self.assertRaises(ValueError): validate('1234a') with self.assertRaises(ValueError): validate('12340') with self.assertRaises(ValueError): validate('12347')
def testValidateTooLongRaises(self): with self.assertRaises(ValueError): validate('1234')