#NEWLINE# def match_readline( self , req , body , sizes ) : #NEWLINE# #INDENT# data = self . szread ( req . body . readline , sizes ) #NEWLINE# count = 1000 #NEWLINE# while len ( body ) : #NEWLINE# #INDENT# if ( body [ : len ( data ) ] != data ) : #NEWLINE# #INDENT# raise AssertionError ( ( 'Invalid data read: %r' % data ) ) #NEWLINE# #UNINDENT# if ( b'\n' in data [ : ( - 1 ) ] ) : #NEWLINE# #INDENT# raise AssertionError ( ( 'Embedded new line: %r' % data ) ) #NEWLINE# #UNINDENT# body = body [ len ( data ) : ] #NEWLINE# data = self . szread ( req . body . readline , sizes ) #NEWLINE# if ( not data ) : #NEWLINE# #INDENT# count -= 1 #NEWLINE# #UNINDENT# if ( count <= 0 ) : #NEWLINE# #INDENT# raise AssertionError ( 'Apparent unexpected EOF' ) #NEWLINE# #UNINDENT# #UNINDENT# if len ( body ) : #NEWLINE# #INDENT# raise AssertionError ( ( 'Failed to read entire body: %r' % body ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if len ( data ) : #NEWLINE# #INDENT# raise AssertionError ( ( 'Read beyond expected body: %r' % data ) ) #NEWLINE# #UNINDENT# #UNINDENT# data = req . body . readline ( sizes ( ) ) #NEWLINE# if data : #NEWLINE# #INDENT# raise AssertionError ( ( 'Read data after body finished: %r' % data ) )