#NEWLINE# def test_read( self ) : #NEWLINE# #INDENT# max_items = 10 #NEWLINE# item = ( [ 1 ] * 10 ) #NEWLINE# class ImageReadIterator ( six . Iterator ) : #NEWLINE# #INDENT# def __init__( self ) : #NEWLINE# #INDENT# self . num_items = 0 #NEWLINE# #UNINDENT# def __iter__( self ) : #NEWLINE# #INDENT# return self #NEWLINE# #UNINDENT# def __next__( self ) : #NEWLINE# #INDENT# if ( self . num_items < max_items ) : #NEWLINE# #INDENT# self . num_items += 1 #NEWLINE# return item #NEWLINE# #UNINDENT# raise StopIteration #NEWLINE# #UNINDENT# next = __next__ #NEWLINE# #UNINDENT# handle = rw_handles . ImageReadHandle ( ImageReadIterator ( ) ) #NEWLINE# for _ in range ( 0 , self ) : #NEWLINE# #INDENT# self . assertEqual ( item , handle . read ( 10 ) ) #NEWLINE# #UNINDENT# self . assertFalse ( handle . read ( 10 ) )