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))
test_fake_marathon.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录