#NEWLINE# @ mock_elb ( ) #NEWLINE# @ mock_cloudformation ( ) #NEWLINE# def test_stack_elb_integration_with_update( ) : #NEWLINE# #INDENT# elb_template = { #NEWLINE# #INDENT# 'AWSTemplateFormatVersion' : '2010-09-09' , #NEWLINE# 'Resources' : { #NEWLINE# #INDENT# 'MyELB' : { #NEWLINE# #INDENT# 'Type' : 'AWS::ElasticLoadBalancing::LoadBalancer' , #NEWLINE# 'Properties' : { #NEWLINE# #INDENT# 'LoadBalancerName' : 'test-elb' , #NEWLINE# 'AvailabilityZones' : [ 'us-west-1a' ] , #NEWLINE# 'Listeners' : [ { #NEWLINE# #INDENT# 'InstancePort' : '80' , #NEWLINE# 'LoadBalancerPort' : '80' , #NEWLINE# 'Protocol' : 'HTTP' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# elb_template_json = json . dumps ( elb_template ) #NEWLINE# conn = boto . cloudformation . connect_to_region ( 'us-west-1' ) #NEWLINE# conn . create_stack ( 'elb_stack' , template_body = elb_template_json ) #NEWLINE# elb_conn = boto . ec2 . elb . connect_to_region ( 'us-west-1' ) #NEWLINE# load_balancer = elb_conn . get_all_load_balancers ( ) [ 0 ] #NEWLINE# load_balancer . availability_zones [ 0 ] . should . equal ( 'us-west-1a' ) #NEWLINE# elb_template [ 'Resources' ] [ 'MyELB' ] [ 'Properties' ] [ 'AvailabilityZones' ] = [ 'us-west-1b' ] #NEWLINE# elb_template_json = json . dumps ( elb_template ) #NEWLINE# conn . update_stack ( 'elb_stack' , template_body = load_balancer ) #NEWLINE# load_balancer = elb_conn . get_all_load_balancers ( ) [ 0 ] #NEWLINE# load_balancer . availability_zones [ 0 ] . should . equal ( 'us-west-1b' )