test_consumers.py 文件源码

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

项目:sauna 作者: NicolasLM 项目源码 文件源码
def test_get_checks_as_dict(self):
        foo = ServiceCheck(timestamp=42, hostname='server1',
                           name='foo', status=0, output='foo out')
        bar = ServiceCheck(timestamp=42, hostname='server1',
                           name='bar', status=1, output='bar out')
        with mock.patch.dict('sauna.check_results', foo=foo, bar=bar):
            self.assertDictEqual(base.AsyncConsumer.get_checks_as_dict(), {
                'foo': {
                    'status': 'OK',
                    'code': 0,
                    'timestamp': 42,
                    'output': 'foo out'
                },
                'bar': {
                    'status': 'WARNING',
                    'code': 1,
                    'timestamp': 42,
                    'output': 'bar out'
                }
            })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号