예제 #1
0
 def test_should_return_empty_dict_for_empty_text_constraint(self):
     constraint = TextConstraint()
     actual_dict = constraint._to_json()
     self.assertTrue(is_empty(actual_dict))
예제 #2
0
 def test_should_return_max_as_dictionary(self):
     expected_dict = {"max": 20}
     constraint = TextConstraint(min=None, max=20)
     actual_dict = constraint._to_json()
     self.assertEqual(expected_dict, actual_dict)
예제 #3
0
 def test_should_return_min_as_dictionary(self):
     expected_dict = {"min": 1}
     constraint = TextConstraint(min=1)
     actual_dict = constraint._to_json()
     self.assertEqual(expected_dict, actual_dict)
예제 #4
0
 def test_should_return_min_max_as_dictionary_for_integer(self):
     expected_dict = {"min": 10, "max": 20}
     constraint = TextConstraint(min=10, max=20)
     actual_dict = constraint._to_json()
     self.assertEqual(expected_dict, actual_dict)
예제 #5
0
 def test_should_return_empty_dict_for_empty_text_constraint(self):
     constraint = TextConstraint()
     actual_dict = constraint._to_json()
     self.assertTrue(is_empty(actual_dict))
예제 #6
0
 def test_should_return_min_as_dictionary(self):
     expected_dict = {"min": 1}
     constraint = TextConstraint(min=1)
     actual_dict = constraint._to_json()
     self.assertEqual(expected_dict, actual_dict)
예제 #7
0
 def test_should_return_max_as_dictionary(self):
     expected_dict = {"max": 20}
     constraint = TextConstraint(min=None, max=20)
     actual_dict = constraint._to_json()
     self.assertEqual(expected_dict, actual_dict)
예제 #8
0
 def test_should_return_min_max_as_dictionary_for_integer(self):
     expected_dict = {"min": 10, "max": 20}
     constraint = TextConstraint(min=10, max=20)
     actual_dict = constraint._to_json()
     self.assertEqual(expected_dict, actual_dict)