test_ez_outlet.py 文件源码

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

项目:ezoutlet 作者: jtpereyda 项目源码 文件源码
def test_reset_unexpected_response_no_sleep(self, mock_time, mock_requests, mock_get_url):
        """
        Given: Mock requests module configured to give unexpected_response_contents
          and: EzOutlet initialized with an IP address and timeout.
        When: Calling reset(post_reset_delay, ez_outlet_reset_interval).
        Then: time.sleep(post_reset_delay + ez_outlet_reset_interval) is _not_ called.
        """
        _ = mock_get_url

        # Given
        self.configure_mock_requests(mock_requests=mock_requests)

        # When
        try:
            self.uut.reset(post_reset_delay=self.post_reset_delay,
                           ez_outlet_reset_interval=self.ez_outlet_reset_interval)
        except ezoutlet.exceptions.EzOutletError:
            pass  # exception tested elsewhere

        # Then
        mock_time.sleep.assert_not_called()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号