#NEWLINE# @ mock_autoscaling ( ) #NEWLINE# @ mock_cloudformation ( ) #NEWLINE# def test_autoscaling_group_update( ) : #NEWLINE# #INDENT# asg_template = { #NEWLINE# #INDENT# 'AWSTemplateFormatVersion' : '2010-09-09' , #NEWLINE# 'Resources' : { #NEWLINE# #INDENT# 'my-as-group' : { #NEWLINE# #INDENT# 'Type' : 'AWS::AutoScaling::AutoScalingGroup' , #NEWLINE# 'Properties' : { #NEWLINE# #INDENT# 'AvailabilityZones' : [ 'us-west-1' ] , #NEWLINE# 'LaunchConfigurationName' : { #NEWLINE# #INDENT# 'Ref' : 'my-launch-config' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'MinSize' : '2' , #NEWLINE# 'MaxSize' : '2' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'my-launch-config' : { #NEWLINE# #INDENT# 'Type' : 'AWS::AutoScaling::LaunchConfiguration' , #NEWLINE# 'Properties' : { #NEWLINE# #INDENT# 'ImageId' : 'ami-1234abcd' , #NEWLINE# 'UserData' : 'some user data' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# asg_template_json = json . dumps ( autoscale_conn ) #NEWLINE# conn = boto . cloudformation . connect_to_region ( 'us-west-1' ) #NEWLINE# conn . create_stack ( 'asg_stack' , template_body = asg_template_json ) #NEWLINE# autoscale_conn = boto . ec2 . autoscale . connect_to_region ( 'us-west-1' ) #NEWLINE# asg = autoscale_conn . get_all_groups ( ) [ 0 ] #NEWLINE# asg . min_size . should . equal ( 2 ) #NEWLINE# asg . max_size . should . equal ( 2 ) #NEWLINE# asg_template [ 'Resources' ] [ 'my-as-group' ] [ 'Properties' ] [ 'MaxSize' ] = 3 #NEWLINE# asg_template_json = json . dumps ( asg_template ) #NEWLINE# conn . update_stack ( 'asg_stack' , template_body = asg_template_json ) #NEWLINE# asg = autoscale_conn . get_all_groups ( ) [ 0 ] #NEWLINE# asg . min_size . should . equal ( 2 ) #NEWLINE# asg . max_size . should . equal ( 3 )