test_synthetics.py 文件源码

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

项目:newrelic-cli 作者: NativeInstruments 项目源码 文件源码
def test_get_monitor_without_script(self, mock):
        get_all_monitors_endpoint = '{}/v3/monitors'.format(
            self.client.base_url
        )
        monitor_script_endpoint = '{}/v3/monitors/{}/script'.format(
            self.client.base_url,
            self.monitor_id
        )
        mock.get(
            url=get_all_monitors_endpoint,
            status_code=200,
            json=self.all_monitors_response
        )
        mock.get(
            url=monitor_script_endpoint,
            status_code=404,
        )
        with self.assertRaisesRegexp(
            newrelic_cli.exceptions.ItemNotFoundError,
            '{}'.format(self.monitor_name)
        ):
            self.client.get_monitor_script(self.monitor_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号