#NEWLINE# @ mock . patch ( 'ec2api.api.route_table._update_routes_in_associated_subnets' ) #NEWLINE# @ mock . patch ( 'ec2api.api.route_table._update_subnet_routes' ) #NEWLINE# def test_replace_route_table_association_rollback( self , routes_updater , multiply_routes_updater ) : #NEWLINE# #INDENT# self . set_mock_db_items ( fakes . DB_ROUTE_TABLE_1 , fakes . DB_ROUTE_TABLE_2 , fakes . DB_ROUTE_TABLE_3 , fakes . DB_SUBNET_2 , fakes . DB_VPC_1 ) #NEWLINE# multiply_routes_updater . side_effect = Exception ( ) #NEWLINE# with tools . ScreeningLogger ( log_name = 'ec2api.api' ) : #NEWLINE# #INDENT# self . assert_execution_error ( self . ANY_EXECUTE_ERROR , 'ReplaceRouteTableAssociation' , { #NEWLINE# #INDENT# 'AssociationId' : fakes . ID_EC2_ROUTE_TABLE_ASSOCIATION_1 , #NEWLINE# 'RouteTableId' : fakes . ID_EC2_ROUTE_TABLE_2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db_api . update_item . assert_any_call ( mock . ANY , fakes . DB_VPC_1 ) #NEWLINE# #UNINDENT# self . db_api . reset_mock ( ) #NEWLINE# routes_updater . side_effect = Exception ( ) #NEWLINE# with tools . ScreeningLogger ( log_name = 'ec2api.api' ) : #NEWLINE# #INDENT# self . assert_execution_error ( multiply_routes_updater . ANY_EXECUTE_ERROR , 'ReplaceRouteTableAssociation' , { #NEWLINE# #INDENT# 'AssociationId' : fakes . ID_EC2_ROUTE_TABLE_ASSOCIATION_3 , #NEWLINE# 'RouteTableId' : fakes . ID_EC2_ROUTE_TABLE_2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db_api . update_item . assert_any_call ( mock . ANY , fakes . DB_SUBNET_2 )