def test_parameter(self): parameter = Parameter() parameter.name = "a" parameter.type = "string" parameter.optional = True parameter.position = 0 parameter_sample = ParameterSample(parameter) self.assertEqual("a", parameter_sample.name) self.assertTrue(parameter_sample.optional) self.assertEqual("my_a", parameter_sample.sample) self.assertFalse(parameter_sample.is_query_string)
def test_parameter_compare__with_name(self): parameter = Parameter() parameter.name = "a" parameter.type = "string" parameter.optional = True parameter.position = 0 parameter_sample1 = ParameterSample(parameter) parameter_sample2 = ParameterSample(parameter) parameter_sample1.name = "a" parameter_sample2.name = "b" self.assertTrue(parameter_sample1 < parameter_sample2)
def test_parameter(self): parameter = Parameter() parameter.name = "a" parameter.description = "b" parameter.type = "foo" parameter.optional = False parameter.position = 1 parameter_dto = RequestParameterDto(parameter) self.assertEqual("a", parameter_dto.name) self.assertEqual("b", parameter_dto.description) self.assertEqual(False, parameter_dto.optional) self.assertEqual(False, parameter_dto.is_internal) self.assertFalse(parameter_dto.is_query_string)