from moto.core.utils import convert_regex_to_flask_path def test_flask_path_converting_simple() -> None: assert convert_regex_to_flask_path("/") == "/" assert convert_regex_to_flask_path("/$") == "/" assert convert_regex_to_flask_path("/foo") == "/foo" assert convert_regex_to_flask_path("/foo/bar/") == "/foo/bar/" def test_flask_path_converting_regex() -> None: assert ( convert_regex_to_flask_path(r"/(?P[a-zA-Z0-9\-_]+)") == r'/' ) assert ( convert_regex_to_flask_path(r"(?P\d+)/(?P.*)$") == r'/' )