#NEWLINE# def test_set_levels_labels_names_bad_input( self ) : #NEWLINE# #INDENT# ( levels , labels ) = ( self . index . levels , self . index . labels ) #NEWLINE# names = self . index . names #NEWLINE# with tm . assertRaisesRegexp ( ValueError , 'Length of levels' ) : #NEWLINE# #INDENT# self . index . set_levels ( [ levels [ 0 ] ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( ValueError , 'Length of labels' ) : #NEWLINE# #INDENT# self . index . set_labels ( [ labels [ 0 ] ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( ValueError , 'Length of names' ) : #NEWLINE# #INDENT# self . index . set_names ( [ names [ 0 ] ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list of lists-like' ) : #NEWLINE# #INDENT# self . index . set_levels ( levels [ 0 ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list of lists-like' ) : #NEWLINE# #INDENT# self . index . set_labels ( labels [ 0 ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list-like' ) : #NEWLINE# #INDENT# self . index . set_names ( names [ 0 ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list of lists-like' ) : #NEWLINE# #INDENT# self . index . set_levels ( levels [ 0 ] , level = [ 0 , 1 ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list-like' ) : #NEWLINE# #INDENT# self . index . set_levels ( levels , level = 0 ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list of lists-like' ) : #NEWLINE# #INDENT# self . index . set_labels ( labels [ 0 ] , level = [ 0 , 1 ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'list-like' ) : #NEWLINE# #INDENT# self . index . set_labels ( labels , level = 0 ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( ValueError , 'Length of names' ) : #NEWLINE# #INDENT# self . index . set_names ( names [ 0 ] , level = [ 0 , 1 ] ) #NEWLINE# #UNINDENT# with tm . assertRaisesRegexp ( TypeError , 'string' ) : #NEWLINE# #INDENT# self . index . set_names ( names , level = 0 )