#NEWLINE# def test_getitem( self ) : #NEWLINE# #INDENT# self . assertEqual ( self . index [ 2 ] , ( 'bar' , 'one' ) ) #NEWLINE# result = self . index [ 2 : 5 ] #NEWLINE# expected = self . index [ [ 2 , 3 , 4 ] ] #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# result = self . index [ [ True , False , True , False , True , True ] ] #NEWLINE# result2 = self . index [ np . array ( [ True , False , True , False , True , True ] ) ] #NEWLINE# expected = self . index [ [ 0 , 2 , 4 , 5 ] ] #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# self . assertTrue ( result2 . equals ( expected ) )