#NEWLINE# def test_set_name_methods( self ) : #NEWLINE# #INDENT# self . assertEqual ( self . index . rename , self . index . set_names ) #NEWLINE# new_names = [ ( name + 'SUFFIX' ) for name in self . index_names ] #NEWLINE# ind = self . index . set_names ( new_names ) #NEWLINE# self . assertEqual ( self . index . names , self . index_names ) #NEWLINE# self . assertEqual ( ind . names , new_names ) #NEWLINE# with assertRaisesRegexp ( ValueError , '^Length' ) : #NEWLINE# #INDENT# ind . set_names ( ( new_names + new_names ) ) #NEWLINE# #UNINDENT# new_names2 = [ ( name + 'SUFFIX2' ) for name in new_names ] #NEWLINE# res = ind . set_names ( new_names2 , inplace = True ) #NEWLINE# self . assertIsNone ( res ) #NEWLINE# self . assertEqual ( ind . names , new_names2 ) #NEWLINE# ind = self . index . set_names ( new_names [ 0 ] , level = 0 ) #NEWLINE# self . assertEqual ( self . index . names , self . index_names ) #NEWLINE# self . assertEqual ( ind . names , [ new_names [ 0 ] , self . index_names [ 1 ] ] ) #NEWLINE# res = ind . set_names ( new_names2 [ 0 ] , level = 0 , inplace = True ) #NEWLINE# self . assertIsNone ( res ) #NEWLINE# self . assertEqual ( ind . names , [ new_names2 [ 0 ] , self . index_names [ 1 ] ] ) #NEWLINE# ind = self . index . set_names ( new_names , level = [ 0 , 1 ] ) #NEWLINE# self . assertEqual ( ind . index . names , self . index_names ) #NEWLINE# self . assertEqual ( ind . names , new_names ) #NEWLINE# res = ind . set_names ( new_names2 , level = [ 0 , 1 ] , inplace = True ) #NEWLINE# self . assertIsNone ( res ) #NEWLINE# self . assertEqual ( ind . names , new_names2 )