#NEWLINE# def test_view_indexing( self ) : #NEWLINE# #INDENT# 'test index access for views' #NEWLINE# self . add_engines ( 2 ) #NEWLINE# targets = self . client . _build_targets ( 'all' ) [ ( - 1 ) ] #NEWLINE# v = self . client [ : ] #NEWLINE# self . assertEquals ( v . targets , targets ) #NEWLINE# t = self . client . ids [ 2 ] #NEWLINE# v = self . client [ t ] #NEWLINE# self . assert_ ( isinstance ( v , DirectView ) ) #NEWLINE# self . assertEquals ( v . targets , t ) #NEWLINE# t = self . client . ids [ 2 : 4 ] #NEWLINE# v = self . client [ t ] #NEWLINE# self . assert_ ( isinstance ( v , DirectView ) ) #NEWLINE# self . assertEquals ( v . targets , t ) #NEWLINE# v = self . client [ : : 2 ] #NEWLINE# self . assert_ ( isinstance ( v , DirectView ) ) #NEWLINE# self . assertEquals ( v . targets , targets [ : : 2 ] ) #NEWLINE# v = self . client [ 1 : : 3 ] #NEWLINE# self . assert_ ( isinstance ( v , DirectView ) ) #NEWLINE# self . assertEquals ( v . targets , targets [ 1 : : 3 ] ) #NEWLINE# v = self . client [ : ( - 3 ) ] #NEWLINE# self . assert_ ( isinstance ( v , DirectView ) ) #NEWLINE# self . assertEquals ( t . targets , targets [ : ( - 3 ) ] ) #NEWLINE# v = self . client [ ( - 1 ) ] #NEWLINE# self . assert_ ( isinstance ( v , DirectView ) ) #NEWLINE# self . assertEquals ( v . targets , targets [ ( - 1 ) ] ) #NEWLINE# self . assertRaises ( TypeError , ( lambda : self . client [ None ] ) )