test_session.py 文件源码

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

项目:rets 作者: refindlyllc 项目源码 文件源码
def test_auto_offset(self):
        with open('tests/rets_responses/COMPACT-DECODED/Search_1of2.xml') as f:
            search1_contents = ''.join(f.readlines())

        with open('tests/rets_responses/COMPACT-DECODED/Search_2of2.xml') as f:
            search2_contents = ''.join(f.readlines())

        with responses.RequestsMock() as resps:
            resps.add(resps.POST, 'http://server.rets.com/rets/Search.ashx',
                      body=search1_contents, status=200, stream=True)
            resps.add(resps.POST, 'http://server.rets.com/rets/Search.ashx',
                      body=search2_contents, status=200, stream=True)
            results = self.session.search(resource='Property',
                                          resource_class='RES',
                                          search_filter={'ListingPrice': 200000})

            self.assertEqual(len(results), 6)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号