test_job_list_requiring_query.py 文件源码

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

项目:TopChef 作者: TopChef 项目源码 文件源码
def test_len(self, length: int) -> None:
        """
        Tests that the length of the job set is whatever the number of
        entries in the SQL query backing this job says it is.

        .. note::

            For some reason, ``unittest.mock`` won't let me set an integer
            bigger than the ``max_value`` specified in this test as a return
            value. Because of that, the max value on the integers needs to
            be constrained.

        :param length: A randomly-generated length
        """
        self.root_query.count = mock.MagicMock(return_value=length)
        self.assertEqual(length, len(self.job_list))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号