mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-07 12:27:46 +00:00
22 lines
547 B
Python
22 lines
547 B
Python
import math
|
|
|
|
import pytest
|
|
|
|
import connexion.utils as utils
|
|
|
|
|
|
def test_flaskify_path():
|
|
assert utils.flaskify_path("{test-path}") == "<test_path>"
|
|
assert utils.flaskify_path("api/{test-path}") == "api/<test_path>"
|
|
|
|
|
|
def test_flaskify_endpoint():
|
|
assert utils.flaskify_endpoint("module.function") == "module_function"
|
|
assert utils.flaskify_endpoint("function") == "function"
|
|
|
|
|
|
def test_get_function_from_name():
|
|
function = utils.get_function_from_name('math.ceil')
|
|
assert function == math.ceil
|
|
assert function(2.7) == 3
|