test_utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:koi 作者: openpermissions 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号