#NEWLINE# def test_simple_123_partial_writes( self ) : #NEWLINE# #INDENT# t = StringTransport ( ) #NEWLINE# p = GeneratorWrapperProtocol ( ) #NEWLINE# def _123_gen_handler( ) : #NEWLINE# #INDENT# for n in ( 1 , 2 , 3 ) : #NEWLINE# #INDENT# s = ( yield n ) #NEWLINE# self . messages . append ( s . read ( n ) [ : ] ) #NEWLINE# #UNINDENT# #UNINDENT# p . init_handler ( _123_gen_handler ( ) ) #NEWLINE# p . makeConnection ( t ) #NEWLINE# p . dataReceived ( 'a' ) #NEWLINE# p . dataReceived ( 'b' ) #NEWLINE# p . dataReceived ( 'bc' ) #NEWLINE# p . dataReceived ( 'cc' ) #NEWLINE# self . assertEquals ( self . pop_messages ( ) , [ 'a' , 'bb' , 'ccc' ] )