test_fake_marathon.py 文件源码

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

项目:marathon-acme 作者: praekeltfoundation 项目源码 文件源码
def test_signal_hup(self):
        """
        When a client calls the ``/mlb_signal/hup`` endpoint, the correct
        response should be returned and the ``signalled_hup`` flag set True.
        """
        assert_that(self.marathon_lb.check_signalled_hup(), Equals(False))

        response = self.client.get('http://localhost/_mlb_signal/hup')
        assert_that(response, succeeded(MatchesAll(
            MatchesStructure(
                code=Equals(200),
                headers=HasHeader('content-type', ['text/plain'])),
            After(methodcaller('text'), succeeded(
                Equals('Sent SIGHUP signal to marathon-lb')))
        )))

        assert_that(self.marathon_lb.check_signalled_hup(), Equals(True))

        # Signalled flag should be reset to false after it is checked
        assert_that(self.marathon_lb.check_signalled_hup(), Equals(False))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号