#NEWLINE# def test_out_of_range( self ) : #NEWLINE# #INDENT# '\n        Should reset to beginning of valid offsets on `OffsetOutOfRangeError`\n        ' #NEWLINE# def _seek( offset , whence ) : #NEWLINE# #INDENT# self . assertEqual ( offset , 0 ) #NEWLINE# self . assertEqual ( whence , 0 ) #NEWLINE# self . consumer . offsets = { #NEWLINE# #INDENT# self . partition : 100 , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# with patch . object ( self . consumer , 'seek' , _seek ) : #NEWLINE# #INDENT# with self . context : #NEWLINE# #INDENT# raise OffsetOutOfRangeError ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( self . consumer . offsets , { #NEWLINE# #INDENT# self . partition : 100 , #NEWLINE# #UNINDENT# } )