def test_make_endpoints():
foo = lambda x: x
endpoints = [
(r"", foo),
(r"/authenticate", foo),
(r"/organisations/{org_id}/assets", foo),
]
res = utils.make_endpoints("x.y", "bar", endpoints)
expected = [
("/", RedirectHandler, {'url': "/vx/bar"}),
("/vx/bar", foo),
("/vx/bar/authenticate", foo),
(r"/vx/bar/organisations/(?P<org_id>{})/assets".format(PATH_PART), foo)
]
assert res == expected
评论列表
文章目录