def test_signed_integer_raises_ValueError(self, mocked_int): for si in ["", "000", "abc"]: mocked_int.side_effect = ValueError with self.assertRaises(ValueError): validatorfuncs.signed_integer(si)
def validate(self, value, **kwargs): return validatorfuncs.signed_integer(value, option_key=self.key, **kwargs)
def test_signed_integer_ok(self): for si in ["123", "4567890", "001", "-123", "-45", "0"]: self.assertEqual(int(si), validatorfuncs.signed_integer(si))
def test_signed_integer_ok(self): for si in ['123', '4567890', '001', '-123', '-45', '0']: self.assertEqual(int(si), validatorfuncs.signed_integer(si))