def test_create_synthetics_alert_condition_no_policy(self, mock):
# Alerts policies list mock
response = {
'policies': []
}
mock.get(
'{}/v2/alerts_policies.json'.format(self.client.base_url),
json=response,
status_code=200
)
# We don't need other endpoints
with self.assertRaisesRegexp(
newrelic_cli.exceptions.ItemNotFoundError,
'{}'.format(self.policy_name)
):
self.client.create_synthetics_alert_condition(
policy_name=self.policy_name,
condition_name=self.monitor_name,
monitor_name=self.monitor_name,
)
评论列表
文章目录