#NEWLINE# def test_read_until_max_bytes_ignores_extra( self ) : #NEWLINE# #INDENT# ( server , client ) = self . make_iostream_pair ( ) #NEWLINE# client . set_close_callback ( ( lambda : self . stop ( 'closed' ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# server . write ( b'abcdef' ) #NEWLINE# with ExpectLog ( gen_log , 'Unsatisfiable read' ) : #NEWLINE# #INDENT# client . read_until ( b'def' , self . stop , max_bytes = 5 ) #NEWLINE# data = self . wait ( ) #NEWLINE# #UNINDENT# self . assertEqual ( data , 'closed' ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# server . close ( ) #NEWLINE# client . close ( )