예제 #1
0
 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)
예제 #2
0
 def validate(self, value, **kwargs):
     return validatorfuncs.signed_integer(value,
                                          option_key=self.key,
                                          **kwargs)
예제 #3
0
 def test_signed_integer_ok(self):
     for si in ["123", "4567890", "001", "-123", "-45", "0"]:
         self.assertEqual(int(si), validatorfuncs.signed_integer(si))
예제 #4
0
 def test_signed_integer_ok(self):
     for si in ['123', '4567890', '001', '-123', '-45', '0']:
         self.assertEqual(int(si), validatorfuncs.signed_integer(si))