def test_get_nonexistent_alert_condition(self, mock):
policy_name = 'IAmNotHerePolicy'
policies_response = {
'policies': []
}
mock.get(
'{}/v2/alerts_policies.json'.format(self.client.base_url),
json=policies_response,
status_code=200
)
# we don't even need a second endpoint here
with self.assertRaisesRegexp(
newrelic_cli.exceptions.ItemNotFoundError,
'{}'.format(policy_name)
):
self.client.get_alert_conditions(policy_name)
评论列表
文章目录