tests.py 文件源码

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

项目:ChiCarto 作者: eeevanbbb 项目源码 文件源码
def test_get_search(self):
        with main.app.test_request_context():
            # Add sample search, and attempt to get the JSON
            # representing it
            sid = self.add_sample_search()
            rv = self.app.get("/search/{0}".format(sid))
            d = json.loads(rv.data.decode("utf-8"))
            # Make sure the search data is still good, and
            # and only 1 search is returned
            assert len(d['searches']) == 1
            search = d['searches'][0]
            assert search['id'] == sid
            assert len(search['data_searches']) == 2
            print ("test_get_search passed")

    # Make sure that we can get a list of searches from the backend in
    # JSON
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号