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