Exemple #1
0
 def test_gt_raises_if_float_value_is_equal_to_arg(self):
     n = SuperNumber(ff_gt=5.5)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['ffGt'],
                      "value is not greater than 5.5")
Exemple #2
0
 def test_lte_raises_if_int_value_is_greater_than_arg(self):
     n = SuperNumber(if_lte=6)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['ifLte'],
                      "value is not less than or equal 5")
Exemple #3
0
 def test_gt_raises_if_int_value_is_less_than_arg(self):
     n = SuperNumber(if_gt=4)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['ifGt'],
                      "value is not greater than 5")
Exemple #4
0
 def test_gte_raises_if_types_value_is_less_than_arg(self):
     n = SuperNumber(t_gte=4)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['tGte'],
                      "value is not greater than or equal 5")
Exemple #5
0
 def test_lt_raises_if_callable_value_is_equal_to_arg(self):
     n = SuperNumber(c_lt=5)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['cLt'],
                      "value is not less than 5")
Exemple #6
0
 def test_lt_raises_if_types_value_is_greater_than_arg(self):
     n = SuperNumber(t_lt=6)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['tLt'],
                      "value is not less than 5")
Exemple #7
0
 def test_max_raises_if_callable_value_is_greater_than_arg(self):
     n = SuperNumber(c_max=6)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['cMax'],
                      "value is not less than or equal 5")
Exemple #8
0
 def test_min_raises_if_float_value_is_less_than_arg(self):
     n = SuperNumber(ff_min=5.4)
     with self.assertRaises(ValidationException) as context:
         n.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['ffMin'],
                      "value is not greater than or equal 5.5")
Exemple #9
0
 def test_gte_doesnt_raise_if_callable_value_is_equal_to_arg(self):
     n = SuperNumber(c_gte=5)
     n.validate()
Exemple #10
0
 def test_gte_doesnt_raise_if_callable_value_is_greater_than_arg(self):
     n = SuperNumber(c_gte=6)
     n.validate()
Exemple #11
0
 def test_gte_doesnt_raise_if_float_value_is_equal_to_arg(self):
     n = SuperNumber(ff_gte=5.5)
     n.validate()
Exemple #12
0
 def test_gt_doesnt_raise_if_float_value_is_greater_than_callable_arg(self):
     n = SuperNumber(fcf_gt=5.6)
     n.validate()
Exemple #13
0
 def test_max_doesnt_raise_if_int_value_is_less_than_arg(self):
     n = SuperNumber(if_max=4)
     n.validate()
Exemple #14
0
 def test_lt_doesnt_raise_if_float_value_is_less_than_arg(self):
     n = SuperNumber(ff_lt=5.4)
     n.validate()
Exemple #15
0
 def test_lt_doesnt_raise_if_types_value_is_less_than_arg(self):
     n = SuperNumber(t_lt=4)
     n.validate()
Exemple #16
0
 def test_lt_doesnt_raise_if_callable_value_is_less_than_arg(self):
     n = SuperNumber(c_lt=4)
     n.validate()
Exemple #17
0
 def test_max_doesnt_raise_if_types_value_is_equal_to_arg(self):
     n = SuperNumber(t_max=5)
     n.validate()
Exemple #18
0
 def test_gte_doesnt_raise_if_types_value_is_greater_than_arg(self):
     n = SuperNumber(t_gte=6)
     n.validate()
Exemple #19
0
 def test_gte_doesnt_raise_if_types_value_is_equatto_arg(self):
     n = SuperNumber(t_gte=5)
     n.validate()
Exemple #20
0
 def test_gt_doesnt_raise_if_int_value_is_greater_than_arg(self):
     n = SuperNumber(if_gt=6)
     n.validate()
Exemple #21
0
 def test_gte_doesnt_raise_if_float_value_is_greater_than_arg(self):
     n = SuperNumber(ff_gte=5.6)
     n.validate()
Exemple #22
0
 def test_min_doesnt_raise_if_int_value_is_equal_to_arg(self):
     n = SuperNumber(t_min=5)
     n.validate()