async def test_extract_parameter_with_arguments(self, app): path = '/test/<string(length=2):parameter>' async with app.test_request_context(): assert extract_path_params(path) == { 'parameter': { 'name': 'parameter', 'type': 'string', 'in': 'path', 'required': True } }
async def test_single_float_parameter(self, app): path = '/test/<float:parameter>' async with app.test_request_context(): assert extract_path_params(path) == { 'parameter': { 'name': 'parameter', 'type': 'number', 'in': 'path', 'required': True } }
async def test_extract_path_with_multiple_parameters(self, app): path = '/test/<parameter>/<int:other>/' async with app.test_request_context(): assert extract_path_params(path) == { 'parameter': { 'name': 'parameter', 'type': 'string', 'in': 'path', 'required': True }, 'other': { 'name': 'other', 'type': 'integer', 'in': 'path', 'required': True } }
async def test_extract_static_path(self, app): path = '/test' async with app.test_request_context(): assert extract_path_params(path) == {}