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)
评论列表
文章目录