#NEWLINE# def test_timeoutPipelining( self ) : #NEWLINE# #INDENT# '\n        When two requests are sent, a timeout call remains around for the\n        second request, and its timeout time is correct.\n        ' #NEWLINE# d1 = self . proto . get ( 'foo' ) #NEWLINE# d2 = self . proto . get ( 'bar' ) #NEWLINE# d3 = Deferred ( ) #NEWLINE# self . proto . connectionLost = d3 . callback #NEWLINE# self . clock . advance ( ( self . proto . persistentTimeOut - 1 ) ) #NEWLINE# self . proto . dataReceived ( 'VALUE foo 0 3\r\nbar\r\nEND\r\n' ) #NEWLINE# def check( result ) : #NEWLINE# #INDENT# self . assertEquals ( result , ( 0 , 'bar' ) ) #NEWLINE# self . assertEquals ( len ( self . clock . calls ) , 1 ) #NEWLINE# for i in range ( self . proto . persistentTimeOut ) : #NEWLINE# #INDENT# self . clock . advance ( 1 ) #NEWLINE# #UNINDENT# return self . assertFailure ( d2 , TimeoutError ) . addCallback ( checkTime ) #NEWLINE# #UNINDENT# def checkTime( ignored ) : #NEWLINE# #INDENT# self . assertEquals ( self . clock . seconds ( ) , ( ( 2 * self . proto . persistentTimeOut ) - 1 ) ) #NEWLINE# #UNINDENT# d1 . addCallback ( check ) #NEWLINE# return d1