test_sse_protocol.py 文件源码

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

项目:marathon-acme 作者: praekeltfoundation 项目源码 文件源码
def test_lost_connection_cancels_timeout(self):
        """
        When the connection is lost, the timeout should be cancelled and have
        no effect.
        """
        timeout = 5
        clock = Clock()
        protocol = make_protocol(timeout=timeout, reactor=clock)
        protocol.connectionMade()

        assert not protocol.transport.disconnecting

        # Lose the connection
        protocol.connectionLost()

        # Advance to the timeout
        clock.advance(timeout)
        # Timeout should *not* be triggered
        assert not protocol.transport.disconnecting
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号