def test_arg2property_with_additional_metadata(self): arg = Arg(minLength=6, maxLength=100) res = arg2property(arg) assert res['minLength'] == 6 assert res['maxLength'] == 100
def test_arg2property_formats(self, pytype, expected_format): arg = Arg(pytype, location='json') res = arg2property(arg) assert res['format'] == expected_format
def test_arg_with_no_type_default_to_string(self): arg = Arg() res = arg2property(arg) assert res['type'] == 'string'
def test_arg2property_with_description(self): arg = Arg(int, location='json', description='status') res = arg2property(arg) assert res['type'] == 'integer' assert res['description'] == arg.metadata['description']