python类index()的实例源码

routes.py 文件源码 项目:WebGames 作者: Julien00859 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def router(app, sio) -> None:
    app.add_route(views.index, "/", methods=["GET"])
    app.add_route(views.signup, "/signup", methods=["POST"])
    app.add_route(views.signin, "/signin", methods=["POST"])
    app.add_route(views.refresh, "/refresh", methods=["POST"])
    app.add_route(views.signout, "/signout", methods=["POST"])
    app.add_route(views.challenge, "/challenge/<token>", methods=["GET"])

    app.static("/assets", pathjoin(".", "client", "assets"))

    sio.on("/join_queue", events.join_queue)
tests.py 文件源码 项目:Startup-Fairy 作者: cs373gc-fall-2016 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def test_about_from_index(self):
        """Test traveling from index to about page"""

        link = 'http://startupfairy.com/'
        httpretty.register_uri(httpretty.GET, link)
        response = requests.get(link)
        self.assertEqual(200, response.status_code)

        link = 'http://startupfairy.com/about'
        httpretty.register_uri(httpretty.GET, link,
                               body='[{"title": "About | Startup Fairy"}]',
                               content_type="application/json")
        response = requests.get(link)
        self.assertEqual(200, response.status_code)
        #self.assertEqual('', httpretty.last_request().body)
tests.py 文件源码 项目:Startup-Fairy 作者: cs373gc-fall-2016 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def test_index_1(self):
        """Test that index renders properly"""

        with app.test_request_context():
            self.assertEqual(index() is not None, True)


问题


面经


文章

微信
公众号

扫码关注公众号