Fix: CloudFormation support status filter in list stacks (#3115)
* Fix: CloudFormation support status filter in list stacks * Added test for non decorator Co-authored-by: usmankb <usman@krazybee.com>
This commit is contained in:
parent
069c159492
commit
c5de56ce70
4 changed files with 41 additions and 3 deletions
|
|
@ -233,6 +233,19 @@ def test_list_stacks():
|
|||
stacks[0].template_description.should.equal("Stack 1")
|
||||
|
||||
|
||||
@mock_cloudformation_deprecated
|
||||
def test_list_stacks_with_filter():
|
||||
conn = boto.connect_cloudformation()
|
||||
conn.create_stack("test_stack", template_body=dummy_template_json)
|
||||
conn.create_stack("test_stack2", template_body=dummy_template_json)
|
||||
conn.update_stack("test_stack", template_body=dummy_template_json2)
|
||||
stacks = conn.list_stacks("CREATE_COMPLETE")
|
||||
stacks.should.have.length_of(1)
|
||||
stacks[0].template_description.should.equal("Stack 1")
|
||||
stacks = conn.list_stacks("UPDATE_COMPLETE")
|
||||
stacks.should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_cloudformation_deprecated
|
||||
def test_delete_stack_by_name():
|
||||
conn = boto.connect_cloudformation()
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ from nose.tools import assert_raises
|
|||
|
||||
from moto import mock_cloudformation, mock_s3, mock_sqs, mock_ec2
|
||||
from moto.core import ACCOUNT_ID
|
||||
from .test_cloudformation_stack_crud import dummy_template_json2
|
||||
|
||||
dummy_template = {
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
|
|
@ -218,6 +219,18 @@ def test_boto3_list_stacksets_length():
|
|||
stacksets.should.have.length_of(2)
|
||||
|
||||
|
||||
@mock_cloudformation
|
||||
def test_boto3_filter_stacks():
|
||||
conn = boto3.client("cloudformation", region_name="us-east-1")
|
||||
conn.create_stack(StackName="test_stack", TemplateBody=dummy_template_json)
|
||||
conn.create_stack(StackName="test_stack2", TemplateBody=dummy_template_json)
|
||||
conn.update_stack(StackName="test_stack", TemplateBody=dummy_template_json2)
|
||||
stacks = conn.list_stacks(StackStatusFilter=["CREATE_COMPLETE"])
|
||||
stacks.get("StackSummaries").should.have.length_of(1)
|
||||
stacks = conn.list_stacks(StackStatusFilter=["UPDATE_COMPLETE"])
|
||||
stacks.get("StackSummaries").should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_cloudformation
|
||||
def test_boto3_list_stacksets_contents():
|
||||
cf_conn = boto3.client("cloudformation", region_name="us-east-1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue