#NEWLINE# def test_replace( self ) : #NEWLINE# #INDENT# cc = sql . ColumnCollection ( ) #NEWLINE# ( c1 , c2a , c3 , c2b ) = ( column ( 'c1' ) , column ( 'c2' ) , column ( 'c3' ) , column ( 'c2' ) ) #NEWLINE# cc . add ( c1 ) #NEWLINE# cc . add ( c2a ) #NEWLINE# cc . add ( c3 ) #NEWLINE# cc . replace ( c2b ) #NEWLINE# eq_ ( cc . _all_columns , [ c1 , c2b , c3 ] ) #NEWLINE# eq_ ( list ( cc ) , [ c1 , c2b , c3 ] ) #NEWLINE# assert ( not cc . contains_column ( c2a ) ) #NEWLINE# assert cc . contains_column ( c2b ) #NEWLINE# ci = cc . as_immutable ( ) #NEWLINE# eq_ ( ci . _all_columns , [ c1 , c2b , c3 ] ) #NEWLINE# eq_ ( list ( ci ) , [ c1 , c2b , c3 ] )