Fix : Added implementation for CloudWatch Describe Metric for Alarm (#3148)
* Fix : added implementation for CloudWatch Describe Metric for Alarm * Linting Co-authored-by: Bert Blommers <info@bertblommers.nl>
This commit is contained in:
parent
bed769a387
commit
09b764148c
3 changed files with 100 additions and 1 deletions
|
|
@ -123,6 +123,24 @@ def test_delete_invalid_alarm():
|
|||
e.exception.response["Error"]["Code"].should.equal("ResourceNotFound")
|
||||
|
||||
|
||||
@mock_cloudwatch
|
||||
def test_describe_alarms_for_metric():
|
||||
conn = boto3.client("cloudwatch", region_name="eu-central-1")
|
||||
conn.put_metric_alarm(
|
||||
AlarmName="testalarm1",
|
||||
MetricName="cpu",
|
||||
Namespace="blah",
|
||||
Period=10,
|
||||
EvaluationPeriods=5,
|
||||
Statistic="Average",
|
||||
Threshold=2,
|
||||
ComparisonOperator="GreaterThanThreshold",
|
||||
ActionsEnabled=True,
|
||||
)
|
||||
alarms = conn.describe_alarms_for_metric(MetricName="cpu", Namespace="blah")
|
||||
alarms.get("MetricAlarms").should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_cloudwatch
|
||||
def test_alarm_state():
|
||||
client = boto3.client("cloudwatch", region_name="eu-central-1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue