Ejemplo n.º 1
0
 def test_should_return_min_as_dictionary(self):
     expected_value = ('range', {"min": 1})
     constraint = NumericRangeConstraint(min=1)
     actual_value = constraint._to_json()
     self.assertEqual(expected_value, actual_value)
Ejemplo n.º 2
0
 def test_should_return_empty_dict_for_empty_integer_constraint(self):
     constraint = NumericRangeConstraint(
     )  #First off there should not be an empty NumericConstraint
     actual_value = constraint._to_json()
     self.assertTrue(is_empty(actual_value[1]))
Ejemplo n.º 3
0
 def test_should_return_max_as_dictionary(self):
     expected_value = ('range', {"max": 20})
     constraint = NumericRangeConstraint(min=None, max=20)
     actual_value = constraint._to_json()
     self.assertEqual(expected_value, actual_value)