moto/tests/test_core/test_url_mapping.py
2013-03-05 08:14:43 -05:00

21 lines
667 B
Python

import sure # flake8: noqa
from moto.core.utils import convert_regex_to_flask_path
def test_flask_path_converting_simple():
convert_regex_to_flask_path("/").should.equal("/")
convert_regex_to_flask_path("/$").should.equal("/")
convert_regex_to_flask_path("/foo").should.equal("/foo")
convert_regex_to_flask_path("/foo/bar/").should.equal("/foo/bar/")
def test_flask_path_converting_regex():
convert_regex_to_flask_path("/(?P<key_name>\w+)").should.equal('/<regex("\w+"):key_name>')
convert_regex_to_flask_path("(?P<account_id>\d+)/(?P<queue_name>.*)$").should.equal(
'<regex("\d+"):account_id>/<regex(".*"):queue_name>'
)