Fix: Adding alarm arn to describe alarms response (#3409)
* Fix: adding alarm arn to describe alarms response * Fix:Delete subscriptions on delete topic * modified tests Co-authored-by: usmankb <usman@krazybee.com>
This commit is contained in:
parent
68e3d394ab
commit
9970be2309
5 changed files with 20 additions and 3 deletions
|
|
@ -3,6 +3,8 @@ from boto.ec2.cloudwatch.alarm import MetricAlarm
|
|||
from boto.s3.key import Key
|
||||
from datetime import datetime
|
||||
import sure # noqa
|
||||
from moto.cloudwatch.utils import make_arn_for_alarm
|
||||
from moto.core import ACCOUNT_ID
|
||||
|
||||
from moto import mock_cloudwatch_deprecated, mock_s3_deprecated
|
||||
|
||||
|
|
@ -51,6 +53,7 @@ def test_create_alarm():
|
|||
list(alarm.ok_actions).should.equal(["arn:ok"])
|
||||
list(alarm.insufficient_data_actions).should.equal(["arn:insufficient"])
|
||||
alarm.unit.should.equal("Seconds")
|
||||
assert "tester" in alarm.alarm_arn
|
||||
|
||||
|
||||
@mock_cloudwatch_deprecated
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import pytz
|
|||
import sure # noqa
|
||||
|
||||
from moto import mock_cloudwatch
|
||||
from moto.cloudwatch.utils import make_arn_for_alarm
|
||||
from moto.core import ACCOUNT_ID
|
||||
|
||||
|
||||
@mock_cloudwatch
|
||||
|
|
@ -140,6 +142,8 @@ def test_describe_alarms_for_metric():
|
|||
alarms = conn.describe_alarms_for_metric(MetricName="cpu", Namespace="blah")
|
||||
alarms.get("MetricAlarms").should.have.length_of(1)
|
||||
|
||||
assert "testalarm1" in alarms.get("MetricAlarms")[0].get("AlarmArn")
|
||||
|
||||
|
||||
@mock_cloudwatch
|
||||
def test_describe_alarms():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue