test_streams.py 文件源码

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

项目:socialhome 作者: jaywink 项目源码 文件源码
def test_get_content_ids__fills_in_non_cached_content_up_to_pagination_amount(self):
        with patch.object(self.stream, "get_cached_content_ids") as mock_cached:
            cached_ids = random.sample(range(10000, 100000), self.stream.paginate_by - 1)
            throughs = dict(zip(cached_ids, cached_ids))
            mock_cached.return_value = cached_ids, throughs
            # Fills up with one of the two that are available
            all_ids = set(cached_ids + [self.site_content.id])
            self.assertEqual(set(self.stream.get_content_ids()[0]), all_ids)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号