#NEWLINE# @ mock . patch ( 'ec2api.api.route_table._update_routes_in_associated_subnets' ) #NEWLINE# def test_replace_route_table_association_main( self , routes_updater ) : #NEWLINE# #INDENT# self . set_mock_db_items ( fakes . DB_ROUTE_TABLE_1 , fakes . DB_ROUTE_TABLE_2 , fakes . DB_VPC_1 ) #NEWLINE# resp = self . execute ( 'ReplaceRouteTableAssociation' , { #NEWLINE# #INDENT# 'AssociationId' : fakes . ID_EC2_ROUTE_TABLE_ASSOCIATION_1 , #NEWLINE# 'RouteTableId' : fakes . ID_EC2_ROUTE_TABLE_2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( fakes . ID_EC2_ROUTE_TABLE_ASSOCIATION_1 , vpc [ 'newAssociationId' ] ) #NEWLINE# vpc = tools . update_dict ( fakes . DB_VPC_1 , { #NEWLINE# #INDENT# 'route_table_id' : fakes . ID_EC2_ROUTE_TABLE_2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db_api . update_item . assert_called_once_with ( mock . ANY , vpc ) #NEWLINE# routes_updater . assert_called_once_with ( mock . ANY , mock . ANY , fakes . DB_ROUTE_TABLE_2 , default_associations_only = True )