#NEWLINE# def test_union( self ) : #NEWLINE# #INDENT# piece1 = piece2 . index [ : 5 ] [ : : ( - 1 ) ] #NEWLINE# piece2 = self . index [ 3 : ] #NEWLINE# the_union = ( piece1 | piece2 ) #NEWLINE# tups = sorted ( self . index . _tuple_index ) #NEWLINE# expected = MultiIndex . from_tuples ( tups ) #NEWLINE# self . assertTrue ( the_union . equals ( expected ) ) #NEWLINE# the_union = self . index . union ( self . index ) #NEWLINE# self . assertIs ( the_union , self . index ) #NEWLINE# the_union = self . index . union ( self . index [ : 0 ] ) #NEWLINE# self . assertIs ( the_union , self . index )