+
    üÐjˆ· ã                   ó  € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	H
t
Ht ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHtHtHtHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIH t  ^ RI!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3 ^ RI4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t= ^ RI>H?t? ^ RI@HAtA ^ RIBHCtCHDtD ^ RIEHFtFHGtG  ! R R]H4      tI ! R R]H4      tJ]A! RR./4      tKR tLR tMR tNR tOR tP ! R R] 4      tQ ! R  R!4      tR ! R" R#]R] 4      tS ! R$ R%]R] 4      tT ! R& R'] 4      tU ! R( R)4      tV ! R* R+4      tW ! R, R-] 4      tX]! ]C4       ! R. R/4      4       tY ! R0 R1] 4      tZ ! R2 R3] 4      t[ ! R4 R5] 4      t\ ! R6 R7] 4      t] ! R8 R9] 4      t^R:# );z&
Tests for L{twisted.web._newclient}.
)ÚOptional)Úimplementer)ÚverifyObject)ÚCancelledErrorÚDeferredÚfailÚsucceed)ÚConnectionDoneÚConnectionLost)Ú	IConsumerÚIPushProducer)ÚProtocol)ÚAccumulatingProtocolÚEventLoggingObserverÚStringTransportÚ StringTransportWithDisconnection)ÚglobalLogPublisher)ÚLineReceiver)ÚFailure)ÚTestCase)ÚBODYÚDONEÚHEADERÚSTATUSÚUNKNOWN_LENGTHÚ
BadHeadersÚBadResponseVersionÚChunkedEncoderÚConnectionAbortedÚExcessWriteÚHTTPClientParserÚ
HTTPParserÚLengthEnforcingConsumerÚ
ParseErrorÚRequestNotSentÚTransportProxyProducerÚWrongBodyLengthÚmakeStatefulDispatcher)	ÚHTTP11ClientProtocolÚPotentialDataLossÚRequestÚRequestGenerationFailedÚRequestTransmissionFailedÚResponseÚResponseDoneÚResponseFailedÚResponseNeverReceived)Ú	_DataLoss)ÚHeaders)ÚIBodyProducerÚ	IResponse)ÚbytesLinearWhitespaceComponentsÚsanitizedBytesc                   ó   € ] tR t^CtRtRtR# )ÚArbitraryExceptionzY
A unique, arbitrary exception type which L{twisted.web._newclient} knows
nothing about.
© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r9   ó    ÚA/usr/lib/python3/dist-packages/twisted/web/test/test_newclient.pyr8   r8   C   s   † õrA   r8   c                   ó   € ] tR t^JtRtRtR# )ÚAnotherArbitraryExceptionzA
Similar to L{ArbitraryException} but with a different identity.
r9   Nr:   r9   rA   rB   rD   rD   J   s   † õrA   rD   ó   hostó   example.comc                ó\   a a€ VV 3R lpS P                  W4      pVP                  V4       V# )aU  
Assert that the given L{Deferred} fails with the exception given by
C{mainType} and that the exceptions wrapped by the instance of C{mainType}
it fails with match the list of exception types given by C{reasonTypes}.

This is a helper for testing failures of exceptions which subclass
L{_newclient._WrapperException}.

@param self: A L{TestCase} instance which will be used to make the
    assertions.

@param deferred: The L{Deferred} which is expected to fail with
    C{mainType}.

@param mainType: A L{_newclient._WrapperException} subclass which will be
    trapped on C{deferred}.

@param reasonTypes: A sequence of exception types which will be trapped on
    the resulting C{mainType} exception instance's C{reasons} sequence.

@return: A L{Deferred} which fires with the C{mainType} instance
    C{deferred} fails with, or which fails somehow.
c           	      óè   <€ \        V P                  S4       F  w  rVP                  V4       K  	  SP                  \	        V P                  4      \	        S4      R V P                   RS R24       V # )zlen(z	) != len(Ú))ÚzipÚreasonsÚtrapÚassertEqualÚlen)ÚerrÚreasonÚtypeÚreasonTypesÚselfs   &  €€rB   ÚcbFailedÚ-assertWrapperExceptionTypes.<locals>.cbFailedn   se   ø€ Ü §¡¨[Ö9‰LˆFØ�K‰K˜Öñ :à×ÑÜ�—‘ÓÜ�ÓØ�3—;‘;�-˜y¨¨°QÐ7ô	
ð
 ˆ
rA   )ÚassertFailureÚaddCallback)rS   ÚdeferredÚmainTyperR   rT   Úds   f&&f  rB   ÚassertWrapperExceptionTypesr[   U   s+   ù€ ö2ð 	×Ñ˜8Ó.€AØ‡M�M�(ÔØ€HrA   c                ó$   € \        W\        V4      # )zc
A simple helper to invoke L{assertWrapperExceptionTypes} with a C{mainType}
of L{ResponseFailed}.
)r[   r/   ©rS   rX   rR   s   &&&rB   ÚassertResponseFailedr^   }   s   € ô
 ' t´~À{ÓSÐSrA   c                ó$   € \        W\        V4      # )zl
A simple helper to invoke L{assertWrapperExceptionTypes} with a C{mainType}
of L{RequestGenerationFailed}.
)r[   r+   r]   s   &&&rB   ÚassertRequestGenerationFailedr`   …   s   € ô
 'ØÔ/°óð rA   c                ó$   € \        W\        V4      # )zn
A simple helper to invoke L{assertWrapperExceptionTypes} with a C{mainType}
of L{RequestTransmissionFailed}.
)r[   r,   r]   s   &&&rB   ÚassertRequestTransmissionFailedrb   �   s   € ô
 'ØÔ1°;óð rA   c                ó(   € \        R^ÈR\        V 4      # )zÚ
Helper function for creating a Response which uses the given transport.
All of the other parameters to L{Response.__init__} are filled with
arbitrary values.  Only use this method if you don't care about any of
them.
ó   OK©ó   HTTPé   rg   )r-   Ú_boringHeaders©Ú	transports   &rB   ÚjustTransportResponserk   ™   s   € ô �O S¨%´ÀÓKÐKrA   c                   ó*   a € ] tR t^£t o RtR tRtV tR# )ÚMakeStatefulDispatcherTestsz&
Tests for L{makeStatefulDispatcher}.
c                ó  €  ! R R4      pV! 4       pV P                  VP                  4       R4       RVn        V P                  VP                  4       R4       RVn        V P                  \        VP                  4       R# )zs
A method defined with L{makeStatefulDispatcher} invokes a second
method based on the current state of the object.
c                   óH   a € ] tR t^®t o RtR t]! R]4      tR tR tRt	V t
R# )ÚCMakeStatefulDispatcherTests.test_functionCalledByState.<locals>.FooÚAc                ó   € R # ©Nr9   ©rS   s   &rB   ÚbarÚGMakeStatefulDispatcherTests.test_functionCalledByState.<locals>.Foo.bar±   s   € ÙrA   Úquuxc                ó   € R # )Úar9   rt   s   &rB   Ú_quux_AÚKMakeStatefulDispatcherTests.test_functionCalledByState.<locals>.Foo._quux_A¶   ó   € ÙrA   c                ó   € R # )Úbr9   rt   s   &rB   Ú_quux_BÚKMakeStatefulDispatcherTests.test_functionCalledByState.<locals>.Foo._quux_B¹   r|   rA   r9   N)r;   r<   r=   r>   Ú_stateru   r'   rz   r   r@   Ú__classdictcell__©Ú__classdict__s   @rB   ÚFoorp   ®   s,   ø‡ € ØˆFòñ )¨°Ó5ˆCò÷ð rA   r…   ry   ÚBr~   ÚCN)rM   ru   r�   ÚassertRaisesÚRuntimeError)rS   r…   Ústatefuls   &  rB   Útest_functionCalledByStateÚ6MakeStatefulDispatcherTests.test_functionCalledByState¨   sc   € ÷	ñ 	ñ “5ˆØ×Ñ˜Ÿ™›¨Ô-ØˆŒØ×Ñ˜Ÿ™›¨Ô-ØˆŒØ×Ñœ,¨¯©Ö5rA   r9   N)r;   r<   r=   r>   r?   r‹   r@   r‚   rƒ   s   @rB   rm   rm   £   s   ø‡ € ñ÷6ð 6rA   rm   c                   óp   a € ] tR t^Ät o RtRtR tR tR tR t	R t
R tR	 tR
 tR tR tV 3R ltRtV tR# )Ú_HTTPParserTestszh
Base test class for L{HTTPParser} which is responsible for the bulk of
the task of parsing HTTP bytes.
Nc                ó\  € . p\        4       pVP                  Vn        VP                  \	        4       4       V P                  VP                  \        4       VP                  RV P                  ,           4       V P                  VR.4       V P                  VP                  \        4       R# )zR
L{HTTPParser} calls its C{statusReceived} method when it receives a
status line.
ó   HTTP/1.1 200 OKN)r!   ÚappendÚstatusReceivedÚmakeConnectionr   rM   Ústater   ÚdataReceivedÚsepr   )rS   ÚstatusÚprotocols   &  rB   Útest_statusCallbackÚ$_HTTPParserTests.test_statusCallbackÌ   s�   € ð
 ˆÜ“<ˆØ"(§-¡-ˆÔØ×Ñ¤Ó 1Ô2Ø×Ñ˜Ÿ™¬Ô0Ø×ÑÐ0°4·8±8Õ;Ô<Ø×Ñ˜Ð"4Ð!5Ô6Ø×Ñ˜Ÿ™¬Ö0rA   c                ó¸   € / p\        4       pVP                  Vn        VP                  \	        4       4       VP                  R V P                  ,           4       W3# )r�   )r!   Ú__setitem__ÚheaderReceivedr“   r   r•   r–   ©rS   Úheaderr˜   s   &  rB   Ú_headerTestSetupÚ!_HTTPParserTests._headerTestSetupÚ   sN   € ØˆÜ“<ˆØ"(×"4Ñ"4ˆÔØ×Ñ¤Ó 1Ô2Ø×ÑÐ0°4·8±8Õ;Ô<ØÐÐrA   c                ó  € V P                  4       w  rVP                  RV P                  ,           4       VP                  V P                  4       V P                  VRR/4       V P                  VP                  \
        4       R# )zM
L{HTTPParser} calls its C{headerReceived} method when it receives a
header.
s	   X-Foo:baró   X-Fooó   barN©r    r•   r–   rM   r”   r   rž   s   &  rB   Útest_headerCallbackÚ$_HTTPParserTests.test_headerCallbackâ   si   € ð
  ×0Ñ0Ó2ÑˆØ×Ñ˜l¨T¯X©XÕ5Ô6ð 	×Ñ˜dŸh™hÔ'Ø×Ñ˜ (¨FÐ!3Ô4Ø×Ñ˜Ÿ™¬Ö.rA   c                ó”  € V P                  4       w  rVP                  RV P                  ,           4       VP                  RV P                  ,           4       VP                  RV P                  ,           4       VP                  V P                  4       V P                  VRR/4       V P                  VP                  \
        4       R# )z|
If a header is split over multiple lines, L{HTTPParser} calls
C{headerReceived} with the entire value once it is received.
ó
   X-Foo: bars    bazs   	quuxr£   s   bar baz	quuxNr¥   rž   s   &  rB   Útest_continuedHeaderCallbackÚ-_HTTPParserTests.test_continuedHeaderCallbackï   s–   € ð
  ×0Ñ0Ó2ÑˆØ×Ñ˜m¨d¯h©hÕ6Ô7Ø×Ñ˜g¨¯©Õ0Ô1Ø×Ñ˜i¨$¯(©(Õ2Ô3Ø×Ñ˜dŸh™hÔ'Ø×Ñ˜ (Ð,<Ð!=Ô>Ø×Ñ˜Ÿ™¬Ö.rA   c                ó&  € V P                  4       w  rV P                  P                  . RO4      pVP                  RV,           4       VP                  RV,           4       VP                  V P                  4       V P	                  VRRRR/4       R# )zt
Leading and trailing linear whitespace is stripped from the header
value passed to the C{headerReceived} callback.
s   X-Bar:s   X-Foo:r£   r¤   s   X-BarN)s    	 s    bar 	s    	rA   )r    r–   Újoinr•   rM   )rS   rŸ   r˜   Úvalues   &   rB   Útest_fieldContentWhitespaceÚ,_HTTPParserTests.test_fieldContentWhitespaceü   sy   € ð
  ×0Ñ0Ó2ÑˆØ—‘—‘Ò@ÓAˆØ×Ñ˜i¨%Õ/Ô0Ø×Ñ˜i¨%Õ/Ô0Ø×Ñ˜dŸh™hÔ'Ø×Ñ˜ (¨F°H¸fÐ!EÖFrA   c                óô   aa€ . oV P                  4       w  poVV3R lpVSn        SP                  V P                  4       V P	                  S\
        .4       V P	                  SP                  \        4       R# )zO
After the last header is received, L{HTTPParser} calls
C{allHeadersReceived}.
c                  óT   <€ S P                  SP                  4       \        Sn        R # rs   )r‘   r”   r   )Úcalledr˜   s   €€rB   ÚallHeadersReceivedÚD_HTTPParserTests.test_allHeadersCallback.<locals>.allHeadersReceived  s   ø€ Ø�M‰M˜(Ÿ.™.Ô)Ü#ˆHŽNrA   N)r    r´   r•   r–   rM   r   r”   r   )rS   rŸ   r´   r³   r˜   s   &  @@rB   Útest_allHeadersCallbackÚ(_HTTPParserTests.test_allHeadersCallback  sd   ù€ ð
 ˆØ×0Ñ0Ó2Ñˆ�ö	$ð '9ˆÔ#Ø×Ñ˜dŸh™hÔ'Ø×Ñ˜¤& Ô*Ø×Ñ˜Ÿ™¬Ö0rA   c                óÄ   € V P                  4       w  rVP                  V P                  4       V P                  V/ 4       V P                  VP                  \
        4       R# )zX
If there are no headers in the message, L{HTTPParser} does not call
C{headerReceived}.
Nr¥   rž   s   &  rB   Útest_noHeaderCallbackÚ&_HTTPParserTests.test_noHeaderCallback  sK   € ð
  ×0Ñ0Ó2ÑˆØ×Ñ˜dŸh™hÔ'Ø×Ñ˜ Ô$Ø×Ñ˜Ÿ™¬Ö.rA   c                óÂ  € \        4       pVP                  \        4       4       VP                  RV P                  ,           4       VP                  RV P                  ,           4       VP                  RV P                  ,           4       VP                  V P                  4       RRR.3.pV P                  V\        VP                  P                  4       4      4       R# )zK
All headers received by L{HTTPParser} are added to
L{HTTPParser.headers}.
r�   r©   ó
   X-Foo: bazr£   r¤   ó   bazN)	r!   r“   r   r•   r–   rM   ÚlistÚheadersÚgetAllRawHeaders)rS   r˜   Úexpecteds   &  rB   Útest_headersSavedOnResponseÚ,_HTTPParserTests.test_headersSavedOnResponse#  sª   € ô
 “<ˆØ×Ñ¤Ó 1Ô2Ø×ÑÐ0°4·8±8Õ;Ô<Ø×Ñ˜m¨d¯h©hÕ6Ô7Ø×Ñ˜m¨d¯h©hÕ6Ô7Ø×Ñ˜dŸh™hÔ'Ø ¨Ð/Ð0Ð1ˆØ×Ñ˜¤4¨×(8Ñ(8×(IÑ(IÓ(KÓ#LÖMrA   c                óÂ   € \        4       p. ROpV F)  pV P                  VP                  V4      RV: R24       K+  	  V P                  VP                  R4      R4       R# )zÐ
L{HTTPParser.isConnectionControlHeader} returns C{True} for headers
which are always connection control headers (similar to "hop-by-hop"
headers from RFC 2616 section 13.5.1) and C{False} for other headers.
z
Expecting z. to be a connection control header, but wasn'ts   datez`Expecting the arbitrarily selected 'date' header to not be a connection control header, but was.N)ó   content-lengthó
   connections
   keep-alives   tes   trailerss   transfer-encodings   upgrades   proxy-connection)r!   Ú
assertTrueÚisConnectionControlHeaderÚassertFalse)rS   r˜   ÚconnHeaderNamesrŸ   s   &   rB   Útest_connectionControlHeadersÚ._HTTPParserTests.test_connectionControlHeaders1  sc   € ô “<ˆò	
ˆó &ˆFØ�O‰OØ×2Ñ2°6Ô:ã"ð%öñ &ð 	×ÑØ×.Ñ.¨wÓ7ð4ö	
rA   c                óÐ   € \        4       pVP                  \        4       4       VP                  \	        4       4       V P                  \        VP                  \	        4       4       R# )zQ
L{HTTPParser.switchToBodyMode} raises L{RuntimeError} if called more
than once.
N)r!   r“   r   ÚswitchToBodyModeÚobjectrˆ   r‰   ©rS   r˜   s   & rB   Útest_switchToBodyModeÚ&_HTTPParserTests.test_switchToBodyModeO  sF   € ô
 “<ˆØ×Ñ¤Ó 1Ô2Ø×!Ñ!¤&£(Ô+Ø×Ñœ,¨×(AÑ(AÄ6Ã8ÖLrA   c                ó6   <€ V ^8„  d   Qh/ S[ S[,          ;R&   # )é   r–   )r   Úbytes)Úformatr„   s   "€rB   Ú__annotate__Ú_HTTPParserTests.__annotate__Ä   s   ø‡ ‚ ñ 
‘%�Ñò rA   r9   )r;   r<   r=   r>   r?   r–   r™   r    r¦   rª   r¯   r¶   r¹   rÂ   rË   rÑ   Ú__annotate_func__r@   r‚   rƒ   s   @rB   rŽ   rŽ   Ä   sN   ø‡ € ñð
  €Cò1ò ò/ò/ò
Gò1ò"/òNò
ò<M÷W ƒ rA   rŽ   c                   ó   € ] tR tRtRtRtRtR# )Ú$HTTPParserRFCComplaintDelimeterTestsiZ  z4
L{_HTTPParserTests} using standard CR LF newlines.
ó   
r9   N©r;   r<   r=   r>   r?   r–   r@   r9   rA   rB   rÛ   rÛ   Z  s   † ñð „CrA   rÛ   c                   ó   € ] tR tRtRtRtRtR# )Ú'HTTPParserNonRFCComplaintDelimeterTestsib  z-
L{_HTTPParserTests} using bare LF newlines.
ó   
r9   NrÝ   r9   rA   rB   rß   rß   b  s   † ñð „CrA   rß   c                   óð   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R%t'V t(R&# )'ÚHTTPClientParserTestsij  zX
Tests for L{HTTPClientParser} which is responsible for parsing HTTP
response messages.
c                ó`   € \        RR4      pV P                  VP                  R4      R4       R# )zR
L{HTTPClientParser.parseVersion} parses a status line into its three
components.
Ns	   CANDY/7.2)s   CANDYé   rÔ   )r    rM   ÚparseVersionrÐ   s   & rB   Útest_parseVersionÚ'HTTPClientParserTests.test_parseVersionp  s,   € ô
 $ D¨$Ó/ˆØ×Ñ˜×.Ñ.¨|Ó<Ð>NÖOrA   c                ó¸   a aa€ \        RR4      p\        oVP                  oVVV 3R lpV! R4       V! R4       V! R4       V! R4       V! R4       V! R4       R# )	zZ
L{HTTPClientParser.parseVersion} raises L{ValueError} when passed an
unparsable version.
Nc                 óf   <€ SP                  SSV 4      pSP                  VP                  V 4       R # rs   )rˆ   rM   Údata)ÚsÚexcÚeÚfrS   s   & €€€rB   ÚcheckParsingÚ@HTTPClientParserTests.test_parseBadVersion.<locals>.checkParsing�  s+   ø€ Ø×#Ñ# A q¨!Ó,ˆCØ×Ñ˜SŸX™X qÖ)rA   ó   foos   foo/bar/bazs   foo/s   foo/..s   foo/a.bs	   foo/-1.-1)r    r   rå   )rS   r˜   rï   rí   rî   s   f  @@rB   Útest_parseBadVersionÚ*HTTPClientParserTests.test_parseBadVersionx  sX   ú€ ô
 $ D¨$Ó/ˆÜˆØ×!Ñ!ˆ÷	*ñ 	�VÔÙ�^Ô$á�WÔÙ�YÔá�ZÔ Ù�\Ö"rA   c                óz  € \        RR\        R4      p\        VR4      pVP                  \	        4       4       VP                  R4       V P                  VP                  P                  R4       V P                  VP                  P                  ^È4       V P                  VP                  P                  R4       R# )z†
L{HTTPClientParser.statusReceived} parses the version, code, and phrase
from the status line and stores them on the response object.
ó   GETó   /Nó   HTTP/1.1 200 OK
rd   re   ©r*   rh   r    r“   r   r•   rM   ÚresponseÚversionÚcodeÚphrase©rS   Úrequestr˜   s   &  rB   Útest_responseStatusParsingÚ0HTTPClientParserTests.test_responseStatusParsingŽ  s”   € ô
 ˜& $¬¸Ó=ˆÜ# G¨TÓ2ˆØ×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×Ñ˜×*Ñ*×2Ñ2°OÔDØ×Ñ˜×*Ñ*×/Ñ/°Ô5Ø×Ñ˜×*Ñ*×1Ñ1°5Ö9rA   c                óz  € \        RR\        R4      p\        VR4      pVP                  \	        4       4       VP                  R4       V P                  VP                  P                  R4       V P                  VP                  P                  ^È4       V P                  VP                  P                  R4       R# )z¿
L{HTTPClientParser.statusReceived} can parse a status line without a
phrase (though such lines are a violation of RFC 7230, section 3.1.2;
nevertheless some broken servers omit the phrase).
rõ   rö   Ns   HTTP/1.1 200
rA   re   rø   rý   s   &  rB   Ú test_responseStatusWithoutPhraseÚ6HTTPClientParserTests.test_responseStatusWithoutPhrase›  s”   € ô ˜& $¬¸Ó=ˆÜ# G¨TÓ2ˆØ×Ñ¤Ó 1Ô2Ø×ÑÐ1Ô2Ø×Ñ˜×*Ñ*×2Ñ2°OÔDØ×Ñ˜×*Ñ*×/Ñ/°Ô5Ø×Ñ˜×*Ñ*×1Ñ1°3Ö7rA   c                óP   a a€ \        RR4      oVV 3R lpV! R4       V! R4       R# )zt
L{HTTPClientParser.statusReceived} raises L{ParseError} if it is called
with a status line which cannot be parsed.
Nc                 ó‚   <€ SP                  \        SP                  V 4      pSP                  VP                  V 4       R # rs   )rˆ   r#   r’   rM   rê   )rë   rì   r˜   rS   s   & €€rB   rï   ÚBHTTPClientParserTests.test_badResponseStatus.<locals>.checkParsing°  s1   ø€ Ø×#Ñ#¤J°×0GÑ0GÈÓKˆCØ×Ñ˜SŸX™X qÖ)rA   rñ   s   HTTP/1.1 bar OK)r    )rS   rï   r˜   s   f @rB   Útest_badResponseStatusÚ,HTTPClientParserTests.test_badResponseStatus©  s+   ù€ ô
 $ D¨$Ó/ˆö	*ñ 	�VÔñ 	Ð'Ö(rA   c                ór  a	€ / p. p. p. o	\        WP                  4      pVP                  Vn        \	        4       pVP                  V4       VP                  V4       VP                  VP                  n        V	3R lVP                  n	        VP                  V4       V P                  VP                  R4       V P                  VP                  \        4       V P                  V. 4       V P                  VR.4       V P                  S	R.4       V P                  VP                  P                  ^ 4       V# )aà  
Assert that L{HTTPClientParser} parses the given C{response} to
C{request}, resulting in a response with no body and no extra bytes and
leaving the transport in the producing state.

@param request: A L{Request} instance which might have caused a server
    to return the given response.
@param status: A string giving the status line of the response to be
    parsed.
@param response: A string giving the response to be parsed.

@return: A C{dict} of headers from the response.
c                  ó&   <€ S P                  R 4      # )T©r‘   )ÚbodyDataFinisheds   €rB   Ú<lambda>Ú3HTTPClientParserTests._noBodyTest.<locals>.<lambda>Ö  s   ø€ Ð6F×6MÑ6MÈdÔ6SrA   Ú	producingrA   T)r    r‘   rœ   r�   r   r“   r•   rù   Ú_bodyDataReceivedÚ_bodyDataFinishedrM   ÚproducerStater”   r   Úlength)
rS   rþ   r—   rù   rŸ   ÚfinishedÚbodyr˜   rj   r  s
   &&&&     @rB   Ú_noBodyTestÚ!HTTPClientParserTests._noBodyTest¼  s
  ø€ ð ˆØˆØˆØÐÜ# G¯_©_Ó=ˆØ"(×"4Ñ"4ˆÔÜ#Ó%ˆ	Ø×Ñ 	Ô*ð 	×Ñ˜fÔ%Ø.2¯k©kˆ×ÑÔ+Ü.Sˆ×ÑÔ+Ø×Ñ˜hÔ'Ø×Ñ˜×0Ñ0°+Ô>Ø×Ñ˜Ÿ™¬Ô.Ø×Ñ˜˜rÔ"Ø×Ñ˜ C 5Ô)Ø×ÑÐ)¨D¨6Ô2Ø×Ñ˜×*Ñ*×1Ñ1°1Ô5ØˆrA   c                ó~   € \        RR\        R4      pRpRpV P                  WV4      pV P                  VRR/4       R# )z¡
If the response is to a HEAD request, no body is expected, the body
callback is not invoked, and the I{Content-Length} header is passed to
the header callback.
ó   HEADrö   Nr÷   s   Content-Length: 10

s   Content-Lengths   10)r*   rh   r  rM   )rS   rþ   r—   rù   rŸ   s   &    rB   Útest_headResponseÚ'HTTPClientParserTests.test_headResponseà  sF   € ô ˜' 4¬¸Ó>ˆØ'ˆØ4ˆØ×!Ñ! '°8Ó<ˆØ×Ñ˜Ð"3°UÐ!;Ö<rA   c                óV   € \        RR\        R4      pRpRpV P                  WV4       R# )zh
If the response code is I{NO CONTENT} (204), no body is expected and
the body callback is not invoked.
rõ   rö   Ns   HTTP/1.1 204 NO CONTENT
rÜ   ©r*   rh   r  ©rS   rþ   r—   rù   s   &   rB   Útest_noContentResponseÚ,HTTPClientParserTests.test_noContentResponseì  s.   € ô
 ˜& $¬¸Ó=ˆØ/ˆØˆØ×Ñ˜¨(Ö3rA   c                óV   € \        RR\        R4      pRpRpV P                  WV4       R# )zj
If the response code is I{NOT MODIFIED} (304), no body is expected and
the body callback is not invoked.
rõ   rö   Ns   HTTP/1.1 304 NOT MODIFIED
rÜ   r  r  s   &   rB   Útest_notModifiedResponseÚ.HTTPClientParserTests.test_notModifiedResponseö  s.   € ô
 ˜& $¬¸Ó=ˆØ1ˆØˆØ×Ñ˜¨(Ö3rA   c                óÚ  € \        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  R4       VP                  R4       VP                  R4       V P                  VP                  \        / 4      4       V P                  VP                  P                  \        RR	./4      4       V P                  VP                  P                  \        4       R# )
zY
The response headers are added to the response object's C{headers}
L{Headers} instance.
rõ   rö   Nc                 ó   € R # rs   r9   ©Úrests   &rB   r  Ú<HTTPClientParserTests.test_responseHeaders.<locals>.<lambda>  ó   € ÁdrA   r÷   s   X-Foo: bar
rÜ   ó   x-foor¤   ©r    r*   rh   r“   r   r•   rM   ÚconnHeadersr2   rù   r¿   ÚassertIdenticalr  r   rÐ   s   & rB   Útest_responseHeadersÚ*HTTPClientParserTests.test_responseHeaders   s¼   € ô
 $Ü�F˜D¤.°$Ó7Ñ9Jó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×ÑÐ/Ô0Ø×Ñ˜gÔ&Ø×Ñ˜×-Ñ-¬w°r«{Ô;Ø×Ñ˜×*Ñ*×2Ñ2´G¸XÈÀxÐ<PÓ4QÔRØ×Ñ˜X×.Ñ.×5Ñ5´~ÖFrA   c                óü  € \        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       V P                  VP                  \        / 4      4       V P                  VP                  P                  \        R	R
./4      4       V P                  VP                  P                  \        4       R# )zo
The multi-line response headers are folded and added to the response
object's C{headers} L{Headers} instance.
rõ   rö   Nc                 ó   € R # rs   r9   r&  s   &rB   r  ÚEHTTPClientParserTests.test_responseHeadersMultiline.<locals>.<lambda>  r)  rA   r÷   s   X-Multiline: a
s       b
rÜ   s   x-multilines   a    br+  rÐ   s   & rB   Útest_responseHeadersMultilineÚ3HTTPClientParserTests.test_responseHeadersMultiline  sÏ   € ô
 $Ü�F˜D¤.°$Ó7Ñ9Jó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×ÑÐ3Ô4Ø×Ñ˜lÔ+Ø×Ñ˜gÔ&Ø×Ñ˜×-Ñ-¬w°r«{Ô;Ø×ÑØ×Ñ×%Ñ%¤w°ÀÀÐ/LÓ'Mô	
ð 	×Ñ˜X×.Ñ.×5Ñ5´~ÖFrA   c           	     óú  € \        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       V P                  VP                  P                  \        / 4      4       V P                  VP                  \        R	R
.RR./4      4       V P                  VP                  P                  ^{4       R# )z^
The connection control headers are added to the parser's C{connHeaders}
L{Headers} instance.
rõ   rö   Nc                 ó   € R # rs   r9   r&  s   &rB   r  Ú>HTTPClientParserTests.test_connectionHeaders.<locals>.<lambda>)  r)  rA   r÷   ó   Content-Length: 123
s   Connection: close
rÜ   rÅ   ó   123rÆ   s   close©r    r*   rh   r“   r   r•   rM   rù   r¿   r2   r,  r  rÐ   s   & rB   Útest_connectionHeadersÚ,HTTPClientParserTests.test_connectionHeaders#  sØ   € ô
 $Ü�F˜D¤.°$Ó7Ñ9Jó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×ÑÐ8Ô9Ø×ÑÐ6Ô7Ø×Ñ˜gÔ&Ø×Ñ˜×*Ñ*×2Ñ2´G¸B³KÔ@Ø×ÑØ× Ñ ÜÐ&¨¨°-À(ÀÐLÓMô	
ð 	×Ñ˜×*Ñ*×1Ñ1°3Ö7rA   c                óÒ  € \        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  R4       VP                  R4       VP                  R4       V P                  VP                  P                  \        RR	./4      4       V P                  VP                  \        / 4      4       V P                  VP                  P                  ^ 4       R# )
z�
If a HEAD request is made, the I{Content-Length} header in the response
is added to the response headers, not the connection control headers.
r  rö   Nc                 ó   € R # rs   r9   r&  s   &rB   r  ÚRHTTPClientParserTests.test_headResponseContentLengthEntityHeader.<locals>.<lambda>=  s   € ÁtrA   r÷   r8  rÜ   rÅ   r9  r:  rÐ   s   & rB   Ú*test_headResponseContentLengthEntityHeaderÚ@HTTPClientParserTests.test_headResponseContentLengthEntityHeader7  sÂ   € ô
 $Ü�G˜T¤>°4Ó8Ñ:Kó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×ÑÐ8Ô9Ø×Ñ˜gÔ&Ø×ÑØ×Ñ×%Ñ%¤wÐ0AÀFÀ8Ð/LÓ'Mô	
ð 	×Ñ˜×-Ñ-¬w°r«{Ô;Ø×Ñ˜×*Ñ*×1Ñ1°1Ö5rA   c                óÜ  € . p\        \        RR\        R4      VP                  4      p\	        4       pVP                  V4       VP                  R4       . pVP                  VP                  n        VP                  R4       VP                  R4       V P                  VP                  R4       V P                  VP                  \        4       VP                  R	4       V P                  VR	.4       V P                  VP                  \        4       VP                  R
4       V P                  VR	R
.4       V P                  VP                  \        4       V P                  VR.4       R# )z»
If a response includes a body with a length given by the
I{Content-Length} header, the bytes which make up the body are passed
to the C{_bodyDataReceived} callback on the L{HTTPParser}.
rõ   rö   Nr÷   s   Content-Length: 10
rÜ   ÚpausedrA   s   xxxxxxs   yyyy)r    r*   rh   r‘   r   r“   r•   rù   r  rM   r  r”   r   r   ©rS   r  r˜   rj   r  s   &    rB   Útest_contentLengthÚ(HTTPClientParserTests.test_contentLengthI  s+  € ð ˆÜ#Ü�F˜D¤.°$Ó7¸¿¹ó
ˆô $Ó%ˆ	Ø×Ñ 	Ô*Ø×ÑÐ4Ô5ØˆØ.2¯k©kˆ×ÑÔ+Ø×ÑÐ7Ô8Ø×Ñ˜gÔ&ð 	×Ñ˜×0Ñ0°(Ô;à×Ñ˜Ÿ™¬Ô.Ø×Ñ˜hÔ'Ø×Ñ˜ ˜zÔ*Ø×Ñ˜Ÿ™¬Ô.Ø×Ñ˜hÔ'Ø×Ñ˜ ¨(Ð3Ô4Ø×Ñ˜Ÿ™¬Ô.Ø×Ñ˜ C 5Ö)rA   c                óþ  € . p\        \        RR\        R4      VP                  4      pVP	                  \        4       4       VP                  R4       . pVP                  VP                  n        VP                  R4       VP                  R4       V P                  VP                  \        4       V P                  V. 4       V P                  VR.4       V P                  VP                  P                  ^ 4       R# )z»
If a response includes a I{Content-Length} header indicating zero bytes
in the response, L{Response.length} is set accordingly and no data is
delivered to L{Response._bodyDataReceived}.
rõ   rö   Nr÷   ó   Content-Length: 0
rÜ   rA   )r    r*   rh   r‘   r“   r   r•   rù   r  rM   r”   r   r  ©rS   r  r˜   r  s   &   rB   Útest_zeroContentLengthÚ,HTTPClientParserTests.test_zeroContentLengthh  sÏ   € ð ˆÜ#Ü�F˜D¤.°$Ó7¸¿¹ó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5àˆØ.2¯k©kˆ×ÑÔ+à×ÑÐ6Ô7Ø×Ñ˜gÔ&à×Ñ˜Ÿ™¬Ô.Ø×Ñ˜˜rÔ"Ø×Ñ˜ C 5Ô)Ø×Ñ˜×*Ñ*×1Ñ1°1Ö5rA   c                ó²   € \        \        RR\        R4      R4      pVP                  \	        4       4       V P                  \        VP                  R4       R# )zÈ
If a response includes multiple, distinct I{Content-Length} headers,
L{HTTPClientParser.dataReceived} raises L{ValueError} to indicate that
the response is invalid and the transport is now unusable.
rõ   rö   Ns9   HTTP/1.1 200 OK
Content-Length: 1
Content-Length: 2

©r    r*   rh   r“   r   rˆ   Ú
ValueErrorr•   rÐ   s   & rB   Ú)test_multipleDistinctContentLengthHeadersÚ?HTTPClientParserTests.test_multipleDistinctContentLengthHeaders�  sL   € ô $¤G¨F°D¼.È$Ó$OÐQUÓVˆà×Ñ¤Ó 1Ô2Ø×ÑÜØ×!Ñ!ðö	
rA   c                ó  € \        \        RR\        R4      R4      pVP                  \	        4       4       VP                  R4       V P                  VP                  P                  ^4       V P                  VP                  \        4       R# )z«
If a response includes multiple, yet equal, I{Content-Length} headers,
L{HTTPClientParser.dataReceived} successfully handles and passes single
length for body processing
rõ   rö   Ns9   HTTP/1.1 200 OK
Content-Length: 1
Content-Length: 1

©r    r*   rh   r“   r   r•   rM   rù   r  r”   r   rÐ   s   & rB   Ú&test_multipleEqualContentLengthHeadersÚ<HTTPClientParserTests.test_multipleEqualContentLengthHeaders“  sr   € ô $¤G¨F°D¼.È$Ó$OÐQUÓVˆà×Ñ¤Ó 1Ô2Ø×Ñðô	
ð 	×Ñ˜×*Ñ*×1Ñ1°1Ô5Ø×Ñ˜Ÿ™¬Ö.rA   c                ó²   € \        \        RR\        R4      R4      pVP                  \	        4       4       V P                  \        VP                  R4       R# )zÔ
If a response includes multiple, distinct I{Content-Length} header
field-values, L{HTTPClientParser.dataReceived} raises L{ValueError} to
indicate that the response is invalid and the transport is now unusable.
rõ   rö   Ns)   HTTP/1.1 200 OK
Content-Length: 1, 2

rM  rÐ   s   & rB   Ú3test_multipleDistinctContentLengthHeaderFieldValuesÚIHTTPClientParserTests.test_multipleDistinctContentLengthHeaderFieldValues¥  sJ   € ô $¤G¨F°D¼.È$Ó$OÐQUÓVˆà×Ñ¤Ó 1Ô2Ø×ÑÜØ×!Ñ!ØFö	
rA   c                ó  € \        \        RR\        R4      R4      pVP                  \	        4       4       VP                  R4       V P                  VP                  P                  ^4       V P                  VP                  \        4       R# )zý
If a response includes multiple, equal I{Content-Length} header
field-values, L{HTTPClientParser.dataReceived} successfully handles and
passes single content-length header for body processing. Field-values
are considered equal by parsed decimal value.
rõ   rö   Ns+   HTTP/1.1 200 OK
Content-Length: 1, 001

rR  rÐ   s   & rB   Ú0test_multipleEqualContentLengthHeaderFieldValuesÚFHTTPClientParserTests.test_multipleEqualContentLengthHeaderFieldValues´  sp   € ô $¤G¨F°D¼.È$Ó$OÐQUÓVˆà×Ñ¤Ó 1Ô2Ø×ÑØHô	
ð 	×Ñ˜×*Ñ*×1Ñ1°1Ô5Ø×Ñ˜Ÿ™¬Ö.rA   c                ó²   € \        \        RR\        R4      R4      pVP                  \	        4       4       V P                  \        VP                  R4       R# )zÇ
If the I{Content-Length} header contains anything other than digits
L{HTTPClientParser.dataReceived} raises L{ValueError} to
indicate that the response is invalid and the transport is now unusable.
rõ   rö   Ns'   HTTP/1.1 200 OK
Content-Length: +1

rM  rÐ   s   & rB   Útest_contentLengthTooPositiveÚ3HTTPClientParserTests.test_contentLengthTooPositiveÄ  óJ   € ô $¤G¨F°D¼.È$Ó$OÐQUÓVˆà×Ñ¤Ó 1Ô2Ø×ÑÜØ×!Ñ!Ø<ö	
rA   c                ó²   € \        \        RR\        R4      R4      pVP                  \	        4       4       V P                  \        VP                  R4       R# )z¸
If the I{Content-Length} header has a negative value
L{HTTPClientParser.dataReceived} raises L{ValueError} to
indicate that the response is invalid and the transport is now unusable.
rõ   rö   Ns'   HTTP/1.1 200 OK
Content-Length: -1

rM  rÐ   s   & rB   Útest_contentLengthNegativeÚ0HTTPClientParserTests.test_contentLengthNegativeÓ  r^  rA   c                óT  € . p\        \        RR\        R4      VP                  4      pVP	                  \        4       4       VP                  R4       VP                  R4       VP                  R4       V P                  VP                  \        4       V P                  VR.4       R# )za
If extra bytes are received past the end of a response, they are passed
to the finish callback.
rõ   rö   Nr÷   rH  ó   
Here is another thing!ó   Here is another thing!©
r    r*   rh   r‘   r“   r   r•   rM   r”   r   ©rS   r  r˜   s   &  rB   Útest_extraBytesPassedBackÚ/HTTPClientParserTests.test_extraBytesPassedBackâ  s�   € ð
 ˆÜ#Ü�F˜D¤.°$Ó7¸¿¹ó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×ÑÐ6Ô7Ø×ÑÐ;Ô<Ø×Ñ˜Ÿ™¬Ô.Ø×Ñ˜Ð$=Ð#>Ö?rA   c                óT  € . p\        \        RR\        R4      VP                  4      pVP	                  \        4       4       VP                  R4       VP                  R4       VP                  R4       V P                  VP                  \        4       V P                  VR.4       R# )z‚
If extra bytes are received past the end of the headers of a response
to a HEAD request, they are passed to the finish callback.
r  rö   Nr÷   s   Content-Length: 12
rc  rd  re  rf  s   &  rB   Útest_extraBytesPassedBackHEADÚ3HTTPClientParserTests.test_extraBytesPassedBackHEADó  s�   € ð
 ˆÜ#Ü�G˜T¤>°4Ó8¸(¿/¹/ó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5Ø×ÑÐ7Ô8Ø×ÑÐ;Ô<Ø×Ñ˜Ÿ™¬Ô.Ø×Ñ˜Ð$=Ð#>Ö?rA   c                óz  € . p\        \        RR\        R4      VP                  4      pVP	                  \        4       4       VP                  R4       . pVP                  VP                  n        VP                  R4       VP                  R4       V P                  V. 4       V P                  VP                  P                  \        4       VP                  R4       V P                  VR.4       VP                  R	4       V P                  VRR
.4       VP                  R4       V P                  VR.4       R# )zÔ
If the response headers indicate the response body is encoded with the
I{chunked} transfer encoding, the body is decoded according to that
transfer encoding before being passed to L{Response._bodyDataReceived}.
rõ   rö   Nr÷   s   Transfer-Encoding: chunked
rÜ   s   3
aó   as   bc
s   bcs
   0

extras   extra)r    r*   rh   r‘   r“   r   r•   rù   r  rM   r-  r  r   rI  s   &   rB   Útest_chunkedResponseBodyÚ.HTTPClientParserTests.test_chunkedResponseBody  s  € ð ˆÜ#Ü�F˜D¤.°$Ó7¸¿¹ó
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ4Ô5àˆØ.2¯k©kˆ×ÑÔ+à×ÑÐ?Ô@Ø×Ñ˜gÔ&ð 	×Ñ˜˜rÔ"ð 	×Ñ˜X×.Ñ.×5Ñ5´~ÔFð 	×Ñ˜iÔ(Ø×Ñ˜ ˜vÔ&Ø×Ñ˜iÔ(Ø×Ñ˜  e˜}Ô-ð
 	×ÑÐ/Ô0Ø×Ñ˜ H :Ö.rA   c                óÐ  € . p\        \        RR\        R4      VP                  4      p\	        4       pVP                  V4       VP                  R4       . pVP                  VP                  n        VP                  R4       VP                  R4       VP                  R4       V P                  VRR.4       VP                  \        R4      4       V P                  VR	.4       R# )
z•
If a response does not include a I{Transfer-Encoding} or a
I{Content-Length}, the end of response body is indicated by the
connection being closed.
rõ   rö   Nr÷   rÜ   rñ   r¤   zsimulated end of connectionrA   )r    r*   rh   r‘   r   r“   r•   rù   r  rM   ÚconnectionLostr	   rD  s   &    rB   Útest_unknownContentLengthÚ/HTTPClientParserTests.test_unknownContentLength)  sÊ   € ð ˆÜ#Ü�F˜D¤.°$Ó7¸¿¹ó
ˆô $Ó%ˆ	Ø×Ñ 	Ô*Ø×ÑÐ4Ô5àˆØ.2¯k©kˆ×ÑÔ+à×Ñ˜gÔ&Ø×Ñ˜fÔ%Ø×Ñ˜fÔ%Ø×Ñ˜ ¨Ð/Ô0Ø×Ñ¤Ð/LÓ MÔNØ×Ñ˜ C 5Ö)rA   c                óV  € . p\        \        RR\        R4      VP                  4      p\	        4       pVP                  V4       VP                  R4       . pVP                  VP                  n        VP                  R4       V P                  VR.4       V P                  VR.4       R# )z”
According to RFC 2616, section 4.4, point 3, if I{Content-Length} and
I{Transfer-Encoding: chunked} are present, I{Content-Length} MUST be
ignored
rõ   rö   Nr÷   s@   Content-Length: 102
Transfer-Encoding: chunked

3
abc
0

ó   abcrA   )
r    r*   rh   r‘   r   r“   r•   rù   r  rM   rD  s   &    rB   Ú%test_contentLengthAndTransferEncodingÚ;HTTPClientParserTests.test_contentLengthAndTransferEncodingA  sž   € ð ˆÜ#Ü�F˜D¤.°$Ó7¸¿¹ó
ˆô $Ó%ˆ	Ø×Ñ 	Ô*Ø×ÑÐ4Ô5àˆØ.2¯k©kˆ×ÑÔ+à×Ñðô	
ð 	×Ñ˜ ˜xÔ(Ø×Ñ˜ C 5Ö)rA   c                óî   € \        4       p\        \        RR\        R4      R4      pVP	                  V4       VP
                  pVP                  \        \        4       4      4       \        W\        .4      # )z¥
If L{HTTPClientParser.connectionLost} is called before the headers are
finished, the C{_responseDeferred} is fired with the L{Failure} passed
to C{connectionLost}.
rõ   rö   N)
r   r    r*   rh   r“   Ú_responseDeferredrq  r   r8   r^   )rS   rj   r˜   ÚresponseDeferreds   &   rB   Útest_connectionLostBeforeBodyÚ3HTTPClientParserTests.test_connectionLostBeforeBody_  sf   € ô $Ó%ˆ	Ü#¤G¨F°D¼.È$Ó$OÐQUÓVˆØ×Ñ 	Ô*à#×5Ñ5ÐØ×Ñ¤Ô(:Ó(<Ó =Ô>ä# DÔ=OÐ<PÓQÐQrA   c                ó(  € \         P                  ! V \        4      p\        4       p\	        \        RR\        R4      R4      pVP                  V4       . pVP                  P                  VP                  4       VP                  R4       V^ ,          pRR lpWTn        VP                  R4       V P                  ^\        V4      4       V^ ,          pVR,          pV P!                  VP"                  \$        4       V P'                  \$        4       R# )z�
If one of the L{Response} methods called by
L{HTTPClientParser.connectionLost} raises an exception, the exception
is logged and not re-raised.
rõ   rö   Nó&   HTTP/1.1 200 OK
Content-Length: 1

c                 ó   € \        4       hrs   ©r8   )rO   s   &rB   ÚfakeBodyDataFinishedÚPHTTPClientParserTests.test_connectionLostWithError.<locals>.fakeBodyDataFinished  s   € Ü$Ó&Ð&rA   Úlog_failurers   )r   ÚcreateWithCleanupr   r   r    r*   rh   r“   ry  rW   r‘   r•   r  rq  ÚassertEqualsrN   ÚassertIsInstancer®   r8   ÚflushLoggedErrors)rS   ÚlogObserverrj   r˜   rù   r�  Úeventrî   s   &       rB   Útest_connectionLostWithErrorÚ2HTTPClientParserTests.test_connectionLostWithErrorn  sá   € ô +×<Ò<¸TÔCUÓVˆÜ#Ó%ˆ	Ü#¤G¨F°D¼.È$Ó$OÐQUÓVˆØ×Ñ 	Ô*àˆØ×"Ñ"×.Ñ.¨x¯©Ô?Ø×ÑÐUÔVØ˜A•;ˆô	'ð &:Ô"à×Ñ Ô%Ø×Ñ˜!œS Ó-Ô.Ø˜A•ˆØ�-Õ ˆØ×Ñ˜aŸg™gÔ'9Ô:Ø×ÑÔ1Ö2rA   c                óä   € \        \        RR\        R4      R 4      pVP                  pVP	                  \        4       4       VP                  \        4       4       V P                  V\        4      # )zq
If no response at all was received and the connection is lost, the
resulting error is L{ResponseNeverReceived}.
r  rö   Nc                 ó   € R # rs   r9   ©Úigns   &rB   r  Ú<HTTPClientParserTests.test_noResponseAtAll.<locals>.<lambda>‘  r)  rA   )
r    r*   rh   ry  r“   r   rq  r
   rV   r0   ©rS   r˜   rZ   s   &  rB   Útest_noResponseAtAllÚ*HTTPClientParserTests.test_noResponseAtAll‹  sb   € ô
 $Ü�G˜T¤>°4Ó8Ñ:Jó
ˆð ×&Ñ&ˆà×Ñ¤Ó 1Ô2Ø×Ñ¤Ó 0Ô1Ø×!Ñ! !Ô%:Ó;Ð;rA   c                óB  € \        \        RR\        R4      R 4      pVP                  pVP	                  \        4       4       VP                  R4       VP                  \        4       4       V P                  V\        4      P                  V P                  \        4      # )zŒ
If a partial response was received and the connection is lost, the
resulting error is L{ResponseFailed}, but not
L{ResponseNeverReceived}.
r  rö   Nc                 ó   € R # rs   r9   rŽ  s   &rB   r  ÚBHTTPClientParserTests.test_someResponseButNotAll.<locals>.<lambda>   r)  rA   ó   2)r    r*   rh   ry  r“   r   r•   rq  r
   rV   r/   rW   r†  r‘  s   &  rB   Útest_someResponseButNotAllÚ0HTTPClientParserTests.test_someResponseButNotAll™  s‡   € ô $Ü�G˜T¤>°4Ó8Ñ:Jó
ˆð ×&Ñ&ˆà×Ñ¤Ó 1Ô2Ø×Ñ˜dÔ#Ø×Ñ¤Ó 0Ô1Ø×!Ñ! !¤^Ó4×@Ñ@Ø×!Ñ!¤>ó
ð 	
rA   c                ó:  € Rp\        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  V4       V P                  \        VRR4      RJ 4       V P                  VP                  \        4       V P                  \        \        VP                  P                  4       4      4      ^ 4       V P                  \        \        VP                  P                  4       4      4      ^ 4       V P                  VP                   4       R# )za
If a response in the 1XX range is received it just gets swallowed and
the parser resets itself.
óœ   HTTP/1.1 103 Early Hints
Server: socketserver/1.0.0
Link: </other/styles.css>; rel=preload; as=style
Link: </other/action.js>; rel=preload; as=script

rõ   rö   Nc                 ó   € R # rs   r9   rŽ  s   &rB   r  ÚCHTTPClientParserTests.test_1XXResponseIsSwallowed.<locals>.<lambda>¹  ó   € ÁTrA   rù   )r    r*   rh   r“   r   r•   rÇ   ÚgetattrrM   r”   r   rN   r¾   r¿   rÀ   r,  Ú_everReceivedData)rS   Úsample103Responser˜   s   &  rB   Útest_1XXResponseIsSwallowedÚ1HTTPClientParserTests.test_1XXResponseIsSwallowed«  sß   € ðð 	ô $Ü�F˜D¤.°$Ó7Ñ9Ió
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ/Ô0ð 	�‰œ ¨*°dÓ;¸tÐCÔDØ×Ñ˜Ÿ™¬Ô0Ø×ÑœœT (×"2Ñ"2×"CÑ"CÓ"EÓFÓGÈÔKØ×ÑœœT (×"6Ñ"6×"GÑ"GÓ"IÓJÓKÈQÔOØ�‰˜×2Ñ2Ö3rA   c                óî  € RpRp\        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  W,           4       V P                  VP                  P                  ^È4       V P                  VP                  P                  \        / 4      4       V P                  VP                  \        RR./4      4       V P                  VP                  P                  ^{4       R# )	zy
When a 1XX response is swallowed, the final response that follows it is
the only one that gets sent to the application.
r›  ó(   HTTP/1.1 200 OK
Content-Length: 123

rõ   rö   Nc                 ó   € R # rs   r9   rŽ  s   &rB   r  ÚUHTTPClientParserTests.test_1XXFollowedByFinalResponseOnlyEmitsFinal.<locals>.<lambda>Ô  rž  rA   rÅ   r9  ©r    r*   rh   r“   r   r•   rM   rù   rû   r¿   r2   r,  r  ©rS   r¡  Úfollowing200Responser˜   s   &   rB   Ú-test_1XXFollowedByFinalResponseOnlyEmitsFinalÚCHTTPClientParserTests.test_1XXFollowedByFinalResponseOnlyEmitsFinalÅ  sÐ   € ðð 	ð  YÐä#Ü�F˜D¤.°$Ó7Ñ9Ió
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ/ÕFÔGà×Ñ˜×*Ñ*×/Ñ/°Ô5Ø×Ñ˜×*Ñ*×2Ñ2´G¸B³KÔ@Ø×Ñ˜×-Ñ-¬wÐ8IÈFÈ8Ð7TÓ/UÔVØ×Ñ˜×*Ñ*×1Ñ1°3Ö7rA   c                ó  € RpRp\        \        RR\        R4      R 4      pVP                  \	        4       4       VP                  VV,           V,           V,           4       V P                  VP                  P                  ^È4       V P                  VP                  P                  \        / 4      4       V P                  VP                  \        RR./4      4       V P                  VP                  P                  ^{4       R# )	zX
It is acceptable for multiple 1XX responses to come through, all of
which get ignored.
r›  r¥  rõ   rö   Nc                 ó   € R # rs   r9   rŽ  s   &rB   r  ÚKHTTPClientParserTests.test_multiple1XXResponsesAreIgnored.<locals>.<lambda>í  rž  rA   rÅ   r9  r¨  r©  s   &   rB   Ú#test_multiple1XXResponsesAreIgnoredÚ9HTTPClientParserTests.test_multiple1XXResponsesAreIgnoredÞ  së   € ðð 	ð  YÐä#Ü�F˜D¤.°$Ó7Ñ9Ió
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑØØõ àõ ð #õ#ô	
ð 	×Ñ˜×*Ñ*×/Ñ/°Ô5Ø×Ñ˜×*Ñ*×2Ñ2´G¸B³KÔ@Ø×Ñ˜×-Ñ-¬wÐ8IÈFÈ8Ð7TÓ/UÔVØ×Ñ˜×*Ñ*×1Ñ1°3Ö7rA   c                óz  € \         P                  ! V \        4      pRp\        \	        RR\
        R4      R 4      pVP                  \        4       4       VP                  V4       V P                  ^\        V4      4       V^ ,          pV P                  VR,          R4       V P                  VR,          ^g4       R# )	z6
When a 1XX response is ignored, Twisted emits a log.
r›  rõ   rö   Nc                 ó   € R # rs   r9   rŽ  s   &rB   r  ÚHHTTPClientParserTests.test_ignored1XXResponseCausesLog.<locals>.<lambda>
  rž  rA   Ú
log_formatz#Ignoring unexpected {code} responserû   )r   r„  r   r    r*   rh   r“   r   r•   r…  rN   )rS   rˆ  r¡  r˜   r‰  s   &    rB   Ú test_ignored1XXResponseCausesLogÚ6HTTPClientParserTests.test_ignored1XXResponseCausesLogü  s¨   € ô +×<Ò<¸TÔCUÓVˆðð 	ô $Ü�F˜D¤.°$Ó7Ñ9Ió
ˆð 	×Ñ¤Ó 1Ô2Ø×ÑÐ/Ô0à×Ñ˜!œS Ó-Ô.Ø˜A•ˆØ×Ñ˜% Õ-Ð/TÔUØ×Ñ˜% �-¨Ö-rA   r9   N))r;   r<   r=   r>   r?   ræ   rò   rÿ   r  r  r  r  r  r"  r.  r3  r;  r@  rE  rJ  rO  rS  rV  rY  r\  r`  rg  rj  rn  rr  rv  r{  rŠ  r’  r˜  r¢  r«  r°  r¶  r@   r‚   rƒ   s   @rB   râ   râ   j  sÁ   ø‡ € ñò
Pò#ò,:ò8ò)ò&"òH
=ò4ò4òGò Gò&8ò(6ò$*ò>6ò2
ò$/ò$
ò/ò 
ò
ò@ò"@ò"#/òJ*ò0*ò<Rò3ò:<ò
ò$4ò48ò28÷<.ð .rA   râ   c                   ó<   a € ] tR tRt o RtRtRtRtR tR t	Rt
V tR# )	ÚSlowRequesti  ah  
L{SlowRequest} is a fake implementation of L{Request} which is easily
controlled externally (for example, by code in a test method).

@ivar stopped: A flag indicating whether C{stopWriting} has been called.

@ivar finished: After C{writeTo} is called, a L{Deferred} which was
    returned by that method.  L{SlowRequest} will never fire this
    L{Deferred}.
rõ   Fc                ó8   € \        4       V n        V P                  # rs   )r   r  ©rS   rj   s   &&rB   ÚwriteToÚSlowRequest.writeTo%  s   € Ü ›
ˆŒØ�}‰}ÐrA   c                ó   € R V n         R# ©TN©Ústoppedrt   s   &rB   ÚstopWritingÚSlowRequest.stopWriting)  ó	   € ØˆŽrA   )r  rÁ  N)r;   r<   r=   r>   r?   ÚmethodrÁ  Ú
persistentr¼  rÂ  r@   r‚   rƒ   s   @rB   r¹  r¹    s*   ø‡ € ñ	ð €FØ€GØ€Jò÷ð rA   r¹  c                   ó.   a € ] tR tRt o RtRtR tRtV tR# )ÚSimpleRequesti-  zý
L{SimpleRequest} is a fake implementation of L{Request} which writes a
short, fixed string to the transport passed to its C{writeTo} method and
returns a succeeded L{Deferred}.  This vaguely emulates the behavior of a
L{Request} with no body producer.
Fc                ó:   € VP                  R 4       \        R4      # )ó
   SOME BYTESN)Úwriter   r»  s   &&rB   r¼  ÚSimpleRequest.writeTo7  s   € Ø�‰˜Ô&Ü�t‹}ÐrA   r9   N)	r;   r<   r=   r>   r?   rÆ  r¼  r@   r‚   rƒ   s   @rB   rÈ  rÈ  -  s   ø‡ € ñð €J÷ð rA   rÈ  c                   óú   a € ] tR tRt o RtR tR tR tR tR t	R t
R(R
 ltR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R  t!R! t"R" t#R# t$R$ t%R% t&R& t'R't(V t)R	# ))ÚHTTP11ClientProtocolTestsi<  zQ
Tests for the HTTP 1.1 client protocol implementation,
L{HTTP11ClientProtocol}.
c                óŒ   € \        4       V n        \        4       V n        V P                  P	                  V P                  4       R# )zB
Create an L{HTTP11ClientProtocol} connected to a fake transport.
N)r   rj   r(   r˜   r“   rt   s   &rB   ÚsetUpÚHTTP11ClientProtocolTests.setUpB  s.   € ô )Ó*ˆŒÜ,Ó.ˆŒØ�‰×$Ñ$ T§^¡^Ö4rA   c                ó    € V P                   P                  \        4       4       V P                  V P                  P                  4       R4       R# )zn
L{HTTP11ClientProtocol.request} accepts a L{Request} and calls its
C{writeTo} method with its own transport.
rÊ  N)r˜   rþ   rÈ  rM   rj   r®   rt   s   &rB   Útest_requestÚ&HTTP11ClientProtocolTests.test_requestJ  s5   € ð
 	�‰×Ñœm›oÔ.Ø×Ñ˜Ÿ™×-Ñ-Ó/°Ö?rA   c                óê   a € S P                   P                  \        4       4       V 3R lpS P                  S P                   P                  \	        4       4      \
        4      pVP                  V4       V# )z§
The second time L{HTTP11ClientProtocol.request} is called, it returns a
L{Deferred} which immediately fires with a L{Failure} wrapping a
L{RequestNotSent} exception.
c                 ó\   <€ SP                  SP                  P                  4       R 4       R# ©rA   N©rM   rj   r®   ©ÚignoredrS   s   &€rB   Ú	cbNotSentÚ?HTTP11ClientProtocolTests.test_secondRequest.<locals>.cbNotSentZ  ó    ø€ Ø×Ñ˜TŸ^™^×1Ñ1Ó3°SÖ9rA   )r˜   rþ   r¹  rV   rÈ  r$   rW   ©rS   rÛ  rZ   s   f  rB   Útest_secondRequestÚ,HTTP11ClientProtocolTests.test_secondRequestR  sT   ø€ ð 	�‰×Ñœk›mÔ,õ	:ð ×Ñ˜tŸ}™}×4Ñ4´]³_ÓEÄ~ÓVˆØ	�‰�iÔ ØˆrA   c                óþ   a € S P                   P                  \        \        R4      4      4       V 3R lpS P	                  S P                   P                  \        4       4      \        4      pVP                  V4       V# )z²
L{HTTP11ClientProtocol.request} returns a L{Deferred} which immediately
fires with a L{Failure} wrapping a L{RequestNotSent} if called after
the protocol has been disconnected.
zsad transportc                 ó\   <€ SP                  SP                  P                  4       R 4       R# r×  rØ  rÙ  s   &€rB   rÛ  ÚLHTTP11ClientProtocolTests.test_requestAfterConnectionLost.<locals>.cbNotSenti  rÝ  rA   )	r˜   rq  r   r	   rV   rþ   rÈ  r$   rW   rÞ  s   f  rB   Útest_requestAfterConnectionLostÚ9HTTP11ClientProtocolTests.test_requestAfterConnectionLosta  s\   ø€ ð 	�‰×$Ñ$¤W¬^¸OÓ-LÓ%MÔNõ	:ð ×Ñ˜tŸ}™}×4Ñ4´]³_ÓEÄ~ÓVˆØ	�‰�iÔ ØˆrA   c                ó®   a €  ! R R4      pS P                   P                  V! 4       4      pV 3R lp\        S V\        .4      pVP	                  V4       V# )zý
If the L{Deferred} returned by L{Request.writeTo} fires with a
L{Failure}, L{HTTP11ClientProtocol.request} disconnects its transport
and returns a L{Deferred} which fires with a L{Failure} of
L{RequestGenerationFailed} wrapping the underlying failure.
c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚCHTTP11ClientProtocolTests.test_failedWriteTo.<locals>.BrokenRequestix  Fc                ó(   € \        \        4       4      # rs   )r   r8   r»  s   &&rB   r¼  ÚKHTTP11ClientProtocolTests.test_failedWriteTo.<locals>.BrokenRequest.writeTo{  s   € ÜÔ.Ó0Ó1Ð1rA   r9   N©r;   r<   r=   r>   rÆ  r¼  r@   r‚   rƒ   s   @rB   ÚBrokenRequestrè  x  s   ø‡ € ØˆJ÷2ð 2rA   rì  c                 ó¬   <€ SP                  SP                  P                  4       SP                  P	                  \        \        R 4      4      4       R# )zyou asked for itN)rÇ   rj   Údisconnectingr˜   rq  r   r	   rÙ  s   &€rB   rT   Ú>HTTP11ClientProtocolTests.test_failedWriteTo.<locals>.cbFailed€  s8   ø€ Ø�O‰O˜DŸN™N×8Ñ8Ô9ð �M‰M×(Ñ(¬´Ð@RÓ1SÓ)TÖUrA   )r˜   rþ   r`   r8   rW   )rS   rì  rZ   rT   s   f   rB   Útest_failedWriteToÚ,HTTP11ClientProtocolTests.test_failedWriteTop  sP   ø€ ÷	2ñ 	2ð �M‰M×!Ñ!¡-£/Ó2ˆõ	Vô *¨$°Ô4FÐ3GÓHˆØ	�‰�hÔØˆrA   c                óx   €  ! R R4      pV P                   P                  V! 4       4      p\        W\        .4      # )z·
If L{Request.writeTo} raises an exception,
L{HTTP11ClientProtocol.request} returns a L{Deferred} which fires with
a L{Failure} of L{RequestGenerationFailed} wrapping that exception.
c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚMHTTP11ClientProtocolTests.test_synchronousWriteToError.<locals>.BrokenRequesti‘  Fc                ó   € \        4       hrs   r€  r»  s   &&rB   r¼  ÚUHTTP11ClientProtocolTests.test_synchronousWriteToError.<locals>.BrokenRequest.writeTo”  s   € Ü(Ó*Ð*rA   r9   Nrë  rƒ   s   @rB   rì  rô  ‘  s   ø‡ € ØˆJ÷+ð +rA   rì  )r˜   rþ   r`   r8   )rS   rì  rZ   s   &  rB   Útest_synchronousWriteToErrorÚ6HTTP11ClientProtocolTests.test_synchronousWriteToErrorŠ  s5   € ÷	+ñ 	+ð �M‰M×!Ñ!¡-£/Ó2ˆÜ,¨TÔ7IÐ6JÓKÐKrA   Nc                óJ  € \        4       pV P                  P                  V4      p\        W\        .4      pV P                  VP                  4       V P                  P                  \        \	        4       4      4       V P                  VP                  4       VR8X  d   VP                  P                  R4       V# VR8X  d_   VP                  P                  \        \        4       4      4       V P                  \        4      pV P                  \!        V4      ^4       V#  V# )a
  
If L{HTTP11ClientProtocol}'s transport is disconnected before the
L{Deferred} returned by L{Request.writeTo} fires, the L{Deferred}
returned by L{HTTP11ClientProtocol.request} fires with a L{Failure} of
L{RequestTransmissionFailed} wrapping the underlying failure.
ÚcallbackNÚerrback)r¹  r˜   rþ   rb   r8   rÉ   rÁ  rq  r   rÇ   r  rú  rû  rD   r‡  rM   rN   )rS   Úmoderþ   rZ   Úerrorss   &&   rB   Ú*test_connectionLostDuringRequestGenerationÚDHTTP11ClientProtocolTests.test_connectionLostDuringRequestGenerationš  sð   € ô “-ˆØ�M‰M×!Ñ! 'Ó*ˆÜ+¨DÔ6HÐ5IÓJˆð 	×Ñ˜Ÿ™Ô)à�‰×$Ñ$¤WÔ-?Ó-AÓ%BÔCð 	�‰˜Ÿ™Ô(à�:ÔØ×Ñ×%Ñ% dÔ+ð ˆð �YÔØ×Ñ×$Ñ$¤WÔ-FÓ-HÓ%IÔJØ×+Ñ+Ô,EÓFˆFØ×ÑœS ›[¨!Ô,ð ˆð ØˆrA   c                ó$   € V P                  R4      # )z¢
If the request passed to L{HTTP11ClientProtocol} finishes generation
successfully after the L{HTTP11ClientProtocol}'s connection has been
lost, nothing happens.
rú  ©rþ  rt   s   &rB   Ú+test_connectionLostBeforeGenerationFinishedÚEHTTP11ClientProtocolTests.test_connectionLostBeforeGenerationFinishedº  s   € ð ×>Ñ>¸zÓJÐJrA   c                ó$   € V P                  R4      # )z£
If the request passed to L{HTTP11ClientProtocol} finished generation
with an error after the L{HTTP11ClientProtocol}'s connection has been
lost, nothing happens.
rû  r  rt   s   &rB   Ú)test_connectionLostBeforeGenerationFailedÚCHTTP11ClientProtocolTests.test_connectionLostBeforeGenerationFailedÂ  s   € ð ×>Ñ>¸yÓIÐIrA   c                óŠ   a a€ \         P                  ! S \        4      oVV 3R lpS P                  R4      P	                  V4      # )zá
If the request passed to L{HTTP11ClientProtocol} finished generation
with an error after the L{HTTP11ClientProtocol}'s connection has been
lost, an error is logged that gives a non-confusing hint to user on what
went wrong.
c                 óØ   <€ SP                  ^\        S4      4       S^ ,          pSP                  RV4       SP                  VR,          R4       SP                  VR,          R4       R# )rg   rƒ  rµ  zJError writing request, but not in valid state to finalize request: {state}r”   ÚCONNECTION_LOSTN)r…  rN   ÚassertInrM   )Úignorer‰  rˆ  rS   s   & €€rB   ÚcheckÚnHTTP11ClientProtocolTests.test_errorMessageOnConnectionLostBeforeGenerationFailedDoesNotConfuse.<locals>.checkÓ  sa   ø€ Ø×Ñ˜a¤ [Ó!1Ô2Ø •NˆEØ�M‰M˜-¨Ô/Ø×ÑØ�lÕ#ð/ôð
 ×Ñ˜U 7�^Ð->Ö?rA   rû  )r   r„  r   rþ  rW   )rS   r  rˆ  s   f @rB   ÚEtest_errorMessageOnConnectionLostBeforeGenerationFailedDoesNotConfuseÚ_HTTP11ClientProtocolTests.test_errorMessageOnConnectionLostBeforeGenerationFailedDoesNotConfuseÊ  sA   ù€ ô +×<Ò<¸TÔCUÓVˆö		@ð ×>Ñ>¸yÓI×UÑUØó
ð 	
rA   c                óÂ   a € S P                   P                  \        RR\        R4      4      pV 3R lpVP	                  V4       S P                   P                  R4       V# )zÀ
When a response is delivered to L{HTTP11ClientProtocol}, the
L{Deferred} previously returned by the C{request} method is called back
with a L{Response} instance and the connection is closed.
rõ   rö   Nc                 ó  <€ SP                  V P                  ^È4       SP                  V P                  \        4       4       SP	                  SP
                  P                  4       SP                  SP                  P                  R4       R# )éÈ   Ú	QUIESCENTN)	rM   rû   r¿   r2   rÇ   rj   rî  r˜   r”   )rù   rS   s   &€rB   Ú	cbRequestÚIHTTP11ClientProtocolTests.test_receiveSimplestResponse.<locals>.cbRequestê  s_   ø€ Ø×Ñ˜XŸ]™]¨CÔ0Ø×Ñ˜X×-Ñ-¬w«yÔ9Ø�O‰O˜DŸN™N×8Ñ8Ô9Ø×Ñ˜TŸ]™]×0Ñ0°+Ö>rA   s9   HTTP/1.1 200 OK
Content-Length: 0
Connection: close

©r˜   rþ   r*   rh   rW   r•   ©rS   rZ   r  s   f  rB   Útest_receiveSimplestResponseÚ6HTTP11ClientProtocolTests.test_receiveSimplestResponseâ  sU   ø€ ð �M‰M×!Ñ!¤'¨&°$¼ÈÓ"MÓNˆõ	?ð 	
�‰�iÔ Ø�‰×"Ñ"ðô	
ð ˆrA   c                óÂ   a € S P                   P                  \        RR\        R4      4      pV 3R lpVP	                  V4       S P                   P                  R4       V# )z¬
The headers included in a response delivered to L{HTTP11ClientProtocol}
are included on the L{Response} instance passed to the callback
returned by the C{request} method.
rõ   rö   Nc                 ó^   <€ \        R RR./4      pSP                  V P                  V4       R# )r*  r¤   r½   N)r2   rM   r¿   )rù   rÁ   rS   s   & €rB   r  ÚHHTTP11ClientProtocolTests.test_receiveResponseHeaders.<locals>.cbRequest  s-   ø€ Ü ¨6°6Ð*:Ð;Ó<ˆHØ×Ñ˜X×-Ñ-¨xÖ8rA   s+   HTTP/1.1 200 OK
X-Foo: bar
X-Foo: baz

r  r  s   f  rB   Útest_receiveResponseHeadersÚ5HTTP11ClientProtocolTests.test_receiveResponseHeadersù  sS   ø€ ð �M‰M×!Ñ!¤'¨&°$¼ÈÓ"MÓNˆõ	9ð 	
�‰�iÔ Ø�‰×"Ñ"ØNô	
ð ˆrA   c                ó0  a aaaa€ . o\        4       o\        SP                  4      oSP                  S4       \	        4       oSP                  S4      pSP                  R4       VVV V3R lpVP                  V4       VV 3R lpVP                  V4       V# )a+  
If response bytes are delivered to L{HTTP11ClientProtocol} before the
L{Deferred} returned by L{Request.writeTo} fires, those response bytes
are parsed as part of the response.

The connection is also closed, because we're in a confusing state, and
therefore the C{quiescentCallback} isn't called.
s8   HTTP/1.1 200 OK
X-Foo: bar
Content-Length: 6

foobarc                 ó  <a a€ \        4       o\        4       ;pSn        S P                  S4       SP	                  SP
                  R 4       SP                  SP                  4       SP	                  S. 4       VP                  VV 3R l4      # )Ú%TRANSMITTING_AFTER_RECEIVING_RESPONSEc                 ó    <€ SSP                   3# rs   ©rê   ©r�  Úprù   s   &€€rB   r  ÚoHTTP11ClientProtocolTests.test_receiveResponseBeforeRequestGenerationDone.<locals>.cbResponse.<locals>.<lambda>*  ó   ø€ ¸À1Ç6Á6Ñ8JrA   )	r   r   ÚclosedDeferredÚdeliverBodyrM   r”   rÇ   rî  rW   )rù   ÚwhenFinishedr%  r˜   ÚquiescentResultrS   rj   s   f @€€€€rB   Ú
cbResponseÚ]HTTP11ClientProtocolTests.test_receiveResponseBeforeRequestGenerationDone.<locals>.cbResponse#  sq   ú€ Ü$Ó&ˆAÜ.6«jÐ8ˆL˜1Ô+Ø× Ñ  Ô#Ø×Ñ˜XŸ^™^Ð-TÔUØ�O‰O˜I×3Ñ3Ô4Ø×Ñ˜_¨bÔ1Ø×+Ñ+Õ,JÓKÐKrA   c                 ób  <€ V w  rSP                  VP                  R4       SP                  VP                  ^È4       SP                  VP                  R4       SP                  VP                  \        RR./4      4       SP                  VR4       SP                  P                  R4       R# )rf   rd   r*  r¤   ó   foobarNre   )rM   rú   rû   rü   r¿   r2   r  rú  )Úresultrù   r  rþ   rS   s   &  €€rB   ÚcbAllResponseÚ`HTTP11ClientProtocolTests.test_receiveResponseBeforeRequestGenerationDone.<locals>.cbAllResponse.  s�   ø€ Ø#‰NˆHØ×Ñ˜X×-Ñ-¨Ô?Ø×Ñ˜XŸ]™]¨CÔ0Ø×Ñ˜XŸ_™_¨eÔ4Ø×Ñ˜X×-Ñ-¬w¸À6À(Ð7KÓ/LÔMØ×Ñ˜T 9Ô-ð ×Ñ×%Ñ% dÖ+rA   )r   r(   r‘   r“   r¹  rþ   r•   rW   )rS   rZ   r,  r1  r˜   r+  rþ   rj   s   f   @@@@rB   Ú/test_receiveResponseBeforeRequestGenerationDoneÚIHTTP11ClientProtocolTests.test_receiveResponseBeforeRequestGenerationDone  sŒ   ü€ ð ˆÜ#Ó%ˆ	Ü'¨×(>Ñ(>Ó?ˆØ×Ñ 	Ô*ä“-ˆØ×Ñ˜WÓ%ˆØ×Ñðô	
÷	Lð 	Lð 	
�‰�jÔ!ö
	,ð 	
�‰�mÔ$ØˆrA   c                ó(  € \        4       p\        4       pW!n        VP                  V4       R\        P
                  ,          pVP                  \        RR\        R4      4      pVP                  RV,           R,           4       \        W\        .4      # )za
The connection is closed when the server respond with a header which
is above the maximum line.
rm  rõ   rö   Ns   HTTP/1.1 200 OK
X-Foo: s   
X-Ignored: ignored

)r   r(   r˜   r“   r   Ú
MAX_LENGTHrþ   r*   rh   r•   r^   r	   )rS   rj   r˜   ÚlongLinerZ   s   &    rB   Ú"test_receiveResponseHeadersTooLongÚ<HTTP11ClientProtocolTests.test_receiveResponseHeadersTooLong=  sŠ   € ô
 5Ó6ˆ	Ü'Ó)ˆØ%ÔØ×Ñ 	Ô*àœ,×1Ñ1Õ1ˆØ×ÑœW V¨T´>À4ÓHÓIˆà×ÑðØ!õ"ð%õô	
ô $ D¬nÐ-=Ó>Ð>rA   c                óâ   a a€ \        4       oS P                  P                  S4      pS P                  P                  R4       R pVP	                  V4       VV 3R lpVP	                  V4       V# )zÇ
If response bytes are delivered to L{HTTP11ClientProtocol} before the
request completes, calling C{connectionLost} on the protocol will
result in protocol being moved to C{'CONNECTION_LOST'} state.
s8   HTTP/1.1 400 BAD REQUEST
Content-Length: 9

tisk tiskc                 óŠ   a a€ \        4       o\        4       ;pSn        S P                  S4       VP	                  VV 3R  l4      # )c                 ó    <€ SSP                   3# rs   r#  r$  s   &€€rB   r  Ú„HTTP11ClientProtocolTests.test_connectionLostAfterReceivingResponseBeforeRequestGenerationDone.<locals>.cbResponse.<locals>.<lambda>j  r'  rA   )r   r   r(  r)  rW   )rù   r*  r%  s   f @rB   r,  ÚrHTTP11ClientProtocolTests.test_connectionLostAfterReceivingResponseBeforeRequestGenerationDone.<locals>.cbResponsef  s:   ù€ Ü$Ó&ˆAÜ.6«jÐ8ˆL˜1Ô+Ø× Ñ  Ô#Ø×+Ñ+Õ,JÓKÐKrA   c                 óâ   <€ SP                   P                  R 4       SP                  P                  \	        \        4       4      4       SP                  SP                  P                  R4       R # )Nr	  )r  rú  r˜   rq  r   r8   rM   r�   )r  rþ   rS   s   &€€rB   r1  ÚuHTTP11ClientProtocolTests.test_connectionLostAfterReceivingResponseBeforeRequestGenerationDone.<locals>.cbAllResponsen  sM   ø€ Ø×Ñ×%Ñ% dÔ+à�M‰M×(Ñ(¬Ô1CÓ1EÓ)FÔGØ×Ñ˜TŸ]™]×1Ñ1Ð3DÖErA   )r¹  r˜   rþ   r•   rW   )rS   rZ   r,  r1  rþ   s   f   @rB   ÚDtest_connectionLostAfterReceivingResponseBeforeRequestGenerationDoneÚ^HTTP11ClientProtocolTests.test_connectionLostAfterReceivingResponseBeforeRequestGenerationDoneW  sd   ù€ ô “-ˆØ�M‰M×!Ñ! 'Ó*ˆØ�‰×"Ñ"ðô	
ò	Lð 	
�‰�jÔ!ö	Fð 	
�‰�mÔ$ØˆrA   c                ó0  a a€ \        4       o\        4       ;pSn        S P                  P	                  \        RR\        R4      4      pS P                  P                  R4       . pVP                  VP                  4       S P                  V. 4       S P                  P                  R4       V^ ,          pVP                  S4       S P                  P                  R4       S P                  P                  R4       VV 3R lpVP                  V4       V# )	z¬
The C{deliverBody} method of the response object with which the
L{Deferred} returned by L{HTTP11ClientProtocol.request} fires can be
used to get the body of the response.
rõ   rö   Ns%   HTTP/1.1 200 OK
Content-Length: 6
rà   rñ   r¤   c                 ó~   <€ SP                  SP                  R 4       SP                  P                  \        4       R# )r/  N)rM   rê   ÚclosedReasonrL   r.   )rÚ  r˜   rS   s   &€€rB   r1  ÚIHTTP11ClientProtocolTests.test_receiveResponseBody.<locals>.cbAllResponse™  s+   ø€ Ø×Ñ˜XŸ]™]¨IÔ6Ø×!Ñ!×&Ñ&¤|Ö4rA   )r   r   r(  r˜   rþ   r*   rh   r•   rW   r‘   rM   r)  )rS   r*  ÚrequestDeferredr0  rù   r1  r˜   s   f     @rB   Útest_receiveResponseBodyÚ2HTTP11ClientProtocolTests.test_receiveResponseBodyw  sè   ù€ ô (Ó)ˆÜ19³Ð;ˆ�xÔ.ØŸ-™-×/Ñ/Ü�F˜D¤.°$Ó7ó
ˆð 	�‰×"Ñ"ØAô	
ð ˆØ×#Ñ# F§M¡MÔ2à×Ñ˜ Ô$ð 	�‰×"Ñ" 5Ô)Ø˜!•9ˆà×Ñ˜XÔ&à�‰×"Ñ" 6Ô*Ø�‰×"Ñ" 6Ô*ö	5ð 	× Ñ  Ô/ØÐrA   c                óP  € V P                   P                  \        RR\        R4      4      pV P                   P	                  R4       . pVP                  VP                  4       V^ ,          p\        4       pVP                  V4       V P                   P	                  R4       V P                   P	                  R4       V P                  VP                  R4       V P                   P                  \        \        R4      4      4       VP                  P                  \         4       R# )	zÑ
If the length of the response body is unknown, the protocol passed to
the response's C{deliverBody} method has its C{connectionLost}
method called with a L{Failure} wrapping a L{PotentialDataLoss}
exception.
rõ   rö   Ns   HTTP/1.1 200 OK

rñ   r¤   r/  z low-level transport disconnected)r˜   rþ   r*   rh   r•   rW   r‘   r   r)  rM   rê   rq  r   r	   rE  rL   r)   ©rS   rG  r0  rù   r˜   s   &    rB   ÚEtest_responseBodyFinishedWhenConnectionLostWhenContentLengthIsUnknownÚ_HTTP11ClientProtocolTests.test_responseBodyFinishedWhenConnectionLostWhenContentLengthIsUnknown   sà   € ð Ÿ-™-×/Ñ/Ü�F˜D¤.°$Ó7ó
ˆð 	�‰×"Ñ"Ð#AÔBàˆØ×#Ñ# F§M¡MÔ2Ø˜!•9ˆä'Ó)ˆØ×Ñ˜XÔ&à�‰×"Ñ" 6Ô*Ø�‰×"Ñ" 6Ô*à×Ñ˜Ÿ™¨	Ô2Ø�‰×$Ñ$Ü”NÐ#EÓFÓGô	
ð 	×Ñ×"Ñ"Ô#4Ö5rA   c                ó`  € V P                   P                  \        RR\        R4      4      pV P                   P	                  R4       . pVP                  VP                  4       V^ ,          p\        4       pVP                  V4       V P                   P	                  R4       V P                   P	                  R4       V P                  VP                  R4       V P                   P                  \        \        4       4      4       \        V \        VP                   4      \        \"        .4      # )zà
If the final chunk has not been received when the connection is lost
(for any reason), the protocol passed to C{deliverBody} has its
C{connectionLost} method called with a L{Failure} wrapping the
exception for that reason.
rõ   rö   Ns/   HTTP/1.1 200 OK
Transfer-Encoding: chunked

ó   3
foo
s   3
bar
r/  )r˜   rþ   r*   rh   r•   rW   r‘   r   r)  rM   rê   rq  r   r8   r^   r   rE  r1   rK  s   &    rB   Ú4test_chunkedResponseBodyUnfinishedWhenConnectionLostÚNHTTP11ClientProtocolTests.test_chunkedResponseBodyUnfinishedWhenConnectionLost½  sí   € ð Ÿ-™-×/Ñ/Ü�F˜D¤.°$Ó7ó
ˆð 	�‰×"Ñ"ØLô	
ð ˆØ×#Ñ# F§M¡MÔ2Ø˜!•9ˆä'Ó)ˆØ×Ñ˜XÔ&à�‰×"Ñ" ?Ô3Ø�‰×"Ñ" ?Ô3à×Ñ˜Ÿ™¨	Ô2à�‰×$Ñ$¤WÔ-?Ó-AÓ%BÔCä#Ø”$�x×,Ñ,Ó-Ô0BÄIÐ/Nó
ð 	
rA   c                óæ   a € S P                   P                  \        RR\        R4      4      pS P                   P	                  R4       \        S V\        .4      pV 3R lpVP                  V4       V# )zù
If the parser L{HTTP11ClientProtocol} delivers bytes to in
C{dataReceived} raises an exception, the exception is wrapped in a
L{Failure} and passed to the parser's C{connectionLost} and then the
L{HTTP11ClientProtocol}'s transport is disconnected.
rõ   rö   Ns   unparseable garbage goes here
c                 ó  <€ SP                  SP                  P                  4       SP                  V P                  ^ ,          P
                  P                  R4       SP                  P                  \        \        R4      4      4       R# )é    s   unparseable garbage goes herez
it is doneN)rÇ   rj   rî  rM   rK   r®   rê   r˜   rq  r   r	   )rì   rS   s   &€rB   rT   ÚLHTTP11ClientProtocolTests.test_parserDataReceivedException.<locals>.cbFailedê  s_   ø€ Ø�O‰O˜DŸN™N×8Ñ8Ô9Ø×ÑØ—‘˜A•×$Ñ$×)Ñ)Ð+Kôð �M‰M×(Ñ(¬´ÀÓ1MÓ)NÖOrA   )r˜   rþ   r*   rh   r•   r^   r#   rW   )rS   rG  rZ   rT   s   f   rB   Ú test_parserDataReceivedExceptionÚ:HTTP11ClientProtocolTests.test_parserDataReceivedExceptionÝ  se   ø€ ð Ÿ-™-×/Ñ/Ü�F˜D¤.°$Ó7ó
ˆð 	�‰×"Ñ"Ð#GÔHÜ   ¼¸ÓEˆõ
	Pð 	
�‰�hÔØˆrA   c                ó˜  € V P                   P                  \        RR\        R4      4      pV P                   P                  P
                  pV P                  VP                  V P
                  4       V P                   P                  \        \        R4      4      4       V P                  VP                  R4       \        W\        .4      # )zƒ
When the HTTP response parser is disconnected, the
L{TransportProxyProducer} which was connected to it as a transport is
stopped.
rõ   rö   Nzconnection done)r˜   rþ   r*   rh   Ú_parserrj   r-  Ú	_producerÚ_disconnectParserr   r	   r^   )rS   rG  rj   s   &  rB   Útest_proxyStoppedÚ+HTTP11ClientProtocolTests.test_proxyStoppedù  sš   € ð Ÿ-™-×/Ñ/Ü�F˜D¤.°$Ó7ó
ˆð —M‘M×)Ñ)×3Ñ3ˆ	Ø×Ñ˜Y×0Ñ0°$·.±.ÔAØ�‰×'Ñ'¬´Ð?PÓ0QÓ(RÔSØ×Ñ˜Y×0Ñ0°$Ô7Ü# D¼NÐ;KÓLÐLrA   c                óì  € \        4       p\        4       pVP                  V4       . p. pVP                  4       P	                  VP
                  4       VP                  4       P	                  VP
                  4       V P                  W43. . 34       V P                  VP                  4       VP                  \        \        4       4      4       V P                  VR.4       V P                  VR.4       R# )z¥
L{HTTP11ClientProtocol.abort} will tell the transport to close its
connection when it is invoked, and returns a C{Deferred} that fires
when the connection is lost.
N)r   r(   r“   ÚabortrW   r‘   rM   rÇ   rî  rq  r   r	   )rS   rj   r˜   Úr1Úr2s   &    rB   Útest_abortClosesConnectionÚ4HTTP11ClientProtocolTests.test_abortClosesConnection  sÂ   € ô $Ó%ˆ	Ü'Ó)ˆØ×Ñ 	Ô*ØˆØˆØ�‰Ó×$Ñ$ R§Y¡YÔ/Ø�‰Ó×$Ñ$ R§Y¡YÔ/Ø×Ñ˜"˜ B¨ 8Ô,Ø�‰˜	×/Ñ/Ô0ð 	×Ñ¤¬Ó(8Ó 9Ô:Ø×Ñ˜˜d˜VÔ$Ø×Ñ˜˜d˜VÖ$rA   c                óH  € \        4       p\        4       pVP                  V4       VP                  \	        \        4       4      4       . pVP                  4       P                  VP                  4       V P                  VR.4       V P                  VP                  R4       R# )zq
L{HTTP11ClientProtocol.abort} called after the connection is lost
returns a C{Deferred} that fires immediately.
Nr	  )r   r(   r“   rq  r   r	   r_  rW   r‘   rM   r�   ©rS   rj   r˜   r0  s   &   rB   Útest_abortAfterConnectionLostÚ7HTTP11ClientProtocolTests.test_abortAfterConnectionLost  s}   € ô
 $Ó%ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø×Ñ¤¬Ó(8Ó 9Ô:àˆØ�‰Ó×$Ñ$ V§]¡]Ô3Ø×Ñ˜ $ Ô(Ø×Ñ˜Ÿ™Ð*;Ö<rA   c                óJ  € \        4       p\        4       pVP                  V4       VP                  \	        RR\
        R4      4      pVP                  4        V P                  VP                  4       VP                  \        \        4       4      4       \        W\        .4      # )zà
The Deferred returned by L{HTTP11ClientProtocol.request} will fire
with a L{ResponseFailed} failure containing a L{ConnectionAborted}
exception, if the connection was aborted before all response headers
have been received.
rõ   rö   N)r   r(   r“   rþ   r*   rh   r_  rÇ   rî  rq  r   r	   r^   r   re  s   &   rB   Útest_abortBeforeResponseBodyÚ6HTTP11ClientProtocolTests.test_abortBeforeResponseBody,  s€   € ô $Ó%ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø×!Ñ!¤'¨&°$¼ÈÓ"MÓNˆØ�‰ÔØ�‰˜	×/Ñ/Ô0Ø×Ñ¤¬Ó(8Ó 9Ô:Ü# DÔ3DÐ2EÓFÐFrA   c                óˆ  a aaaa€ \        RR7      o\        4       oSP                  S4       SP                  \	        RR\
        R4      4      pSP                  R4       \        4       o ! VV3R lR\        4      oVVV V3R	 lpV 3R
 lpVP                  V4       \        S S\        \        .4      pVP                  V4      # )a#  
When the connection is aborted after the response headers have
been received and the L{Response} has been made available to
application code, the response body protocol's C{connectionLost}
method will be invoked with a L{ResponseFailed} failure containing a
L{ConnectionAborted} exception.
T)Úlenientrõ   rö   Nr~  c                   ó>   <a € ] tR tRt o RtV3R ltV3R ltRtV tR# )ÚQHTTP11ClientProtocolTests.test_abortAfterResponseHeaders.<locals>.BodyDestinationiP  zH
A body response protocol which immediately aborts the HTTP
connection.
c                ó(   <€ SP                  4        R# )z
Abort the HTTP connection.
N)r_  rÐ   s   &€rB   ÚconnectionMadeÚ`HTTP11ClientProtocolTests.test_abortAfterResponseHeaders.<locals>.BodyDestination.connectionMadeV  s   ø€ ð —‘Ö rA   c                ó*   <€ SP                  V4       R# )z`
Make the reason for the losing of the connection available to
the unit test via C{testResult}.
N)rû  )rS   rP   Ú
testResults   &&€rB   rq  Ú`HTTP11ClientProtocolTests.test_abortAfterResponseHeaders.<locals>.BodyDestination.connectionLost\  s   ø€ ð
 ×"Ñ" 6Ö*rA   r9   N)	r;   r<   r=   r>   r?   rp  rq  r@   r‚   )r„   r˜   rs  s   @€€rB   ÚBodyDestinationrn  P  s   ù‡ € ñõ
!÷+ó +rA   ru  c                ó®   <€ V P                  S! 4       4       SP                  SP                  4       SP                  \	        \        4       4      4       R# )z¤
Connect the L{BodyDestination} response body protocol to the
response, and then simulate connection loss after ensuring that
the HTTP connection has been aborted.
N)r)  rÇ   rî  rq  r   r	   )rù   ru  r˜   rS   rj   s   &€€€€rB   r)  ÚMHTTP11ClientProtocolTests.test_abortAfterResponseHeaders.<locals>.deliverBodyc  s>   ø€ ð × Ñ ¡Ó!2Ô3Ø�O‰O˜I×3Ñ3Ô4Ø×#Ñ#¤G¬NÓ,<Ó$=Ö>rA   c                 óH   <€ SP                  V P                  \        4       R # rs   )r†  rù   r-   )ÚerrorrS   s   &€rB   Ú
checkErrorÚLHTTP11ClientProtocolTests.test_abortAfterResponseHeaders.<locals>.checkErrorm  s   ø€ Ø×!Ñ! %§.¡.´(Ö;rA   )r   r(   r“   rþ   r*   rh   r•   r   r   rW   r^   r   r1   )	rS   r0  r)  rz  rX   ru  r˜   rs  rj   s	   f    @@@@rB   Útest_abortAfterResponseHeadersÚ8HTTP11ClientProtocolTests.test_abortAfterResponseHeaders<  s°   ü€ ô $¨DÔ1ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø×!Ñ!¤'¨&°$¼ÈÓ"MÓNˆà×ÑÐUÔVä“Zˆ
÷	+ð 	+œhô 	+÷&	?ð 	?õ	<ð 	×Ñ˜;Ô'Ü'Ø�*Ô0´)Ð<ó
ˆð ×#Ñ# JÓ/Ð/rA   c           
     óv  a aa€ . oVVV 3R lp\        4       p\        V4      oSP                  V4       SP                  \	        RR\
        RRR7      4      pSP                  R4       S P                  S. 4       . pVP                  VP                  4       V^ ,          p\        4       p\        4       Vn        VP                  P                  V3R l4       VP                  V4       SP                  R	4       VP                  P                  \         4       S P                  SSR
.4       S P                  SP"                  R4       S P                  SP$                  R4       S P                  SP&                  R4       S P                  SP(                  R4       S P                  SP*                  R4       R# )aÁ  
If after a response is done the {HTTP11ClientProtocol} stays open and
returns to QUIESCENT state, all per-request state is reset and the
C{quiescentCallback} is called with the protocol instance.

This is useful for implementing a persistent connection pool.

The C{quiescentCallback} is called *before* the response-receiving
protocol's C{connectionLost}, so that new requests triggered by end of
first request can re-use a persistent connection.
c                 ó†   <€ SP                  V S4       SP                  V P                  R 4       SP                  V 4       R# ©r  N©rM   r”   r‘   ©r%  r˜   r+  rS   s   &€€€rB   rú  ÚHHTTP11ClientProtocolTests.test_quiescentCallbackCalled.<locals>.callback„  ó5   ø€ Ø×Ñ˜Q Ô)Ø×Ñ˜QŸW™W kÔ2Ø×"Ñ" 1Ö%rA   rõ   rö   NT©rÆ  s&   HTTP/1.1 200 OK
Content-length: 3

c                 ó&   <€ SP                  R 4      # )úresponse doner  )r�  r+  s   &€rB   r  ÚHHTTP11ClientProtocolTests.test_quiescentCallbackCalled.<locals>.<lambda>ž  s   ø€ ˜×.Ñ.¨Ô?rA   ru  r‡  )r   r(   r“   rþ   r*   rh   r•   rM   rW   r‘   r   r   r(  r)  rE  rL   r.   rY  Ú_finishedRequestÚ_currentRequestÚ_transportProxyry  )	rS   rú  rj   rG  r0  rù   ÚbodyProtocolr˜   r+  s	   f      @@rB   Útest_quiescentCallbackCalledÚ6HTTP11ClientProtocolTests.test_quiescentCallbackCalledv  sx  ú€ ð ˆ÷	&ô
 $Ó%ˆ	Ü'¨Ó1ˆØ×Ñ 	Ô*à"×*Ñ*Ü�F˜D¤.°$À4ÔHó
ˆð 	×ÑÐUÔVð 	×Ñ˜¨"Ô-àˆØ×#Ñ# F§M¡MÔ2Ø˜!•9ˆô ,Ó-ˆÜ&.£jˆÔ#Ø×#Ñ#×/Ñ/Ü?ô	
ð 	×Ñ˜\Ô*Ø×Ñ˜fÔ%Ø×!Ñ!×&Ñ&¤|Ô4ð 	×Ñ˜¨8°_Ð*EÔFð 	×Ñ˜×)Ñ)¨4Ô0Ø×Ñ˜×2Ñ2°DÔ9Ø×Ñ˜×1Ñ1°4Ô8Ø×Ñ˜×1Ñ1°4Ô8Ø×Ñ˜×3Ñ3°TÖ:rA   c           
     óœ  a aa€ . oVVV 3R lp\        4       p\        V4      oSP                  V4       SP                  \	        RR\
        RRR7      4      pSP                  R4       S P                  V4      pS P                  VP                  R4       S P                  \        S4      ^4       S P                  VP                  R	4       R# )
aœ  
The C{quiescentCallback} passed to L{HTTP11ClientProtocol} will only be
invoked once that protocol is in a state similar to its initial state.
One of the aspects of this initial state is the producer-state of its
transport; an L{HTTP11ClientProtocol} begins with a transport that is
producing, i.e. not C{pauseProducing}'d.

Therefore, when C{quiescentCallback} is invoked the protocol will still
be producing.
c                 ó†   <€ SP                  V S4       SP                  V P                  R 4       SP                  V 4       R# r€  r�  r‚  s   &€€€rB   rú  Ú]HTTP11ClientProtocolTests.test_transportProducingWhenQuiescentAfterFullBody.<locals>.callback¼  r„  rA   rõ   rö   NTr…  s)   HTTP/1.1 200 OK
Content-length: 3

BBBÚDEFERRED_CLOSEr  )r   r(   r“   rþ   r*   rh   r•   ÚsuccessResultOfrM   r�   rN   r  )rS   rú  rj   rG  rù   r˜   r+  s   f    @@rB   Ú1test_transportProducingWhenQuiescentAfterFullBodyÚKHTTP11ClientProtocolTests.test_transportProducingWhenQuiescentAfterFullBody¯  s¾   ú€ ð ˆ÷	&ô
 $Ó%ˆ	Ü'¨Ó1ˆØ×Ñ 	Ô*Ø"×*Ñ*Ü�F˜D¤.°$À4ÔHó
ˆð 	×Ñðô	
ð ×'Ñ'¨Ó8ˆð 	×Ñ˜Ÿ™Ð*:Ô;ð
 	×Ñœ˜_Ó-¨qÔ1ð
 	×Ñ˜×0Ñ0°+Ö>rA   c           
     ó¬  a aa€ . oVVV 3R lp\        4       p\        V4      oSP                  V4       SP                  \	        RR\
        RRR7      4      pVP                  SP                  4       SP                  R4       S P                  \        S4      ^4       S P                  S^ ,          S4       S P                  S^,          \        4       R# )zp
The quiescentCallback is called before the request C{Deferred} fires,
in cases where the response has no body.
c                 ó†   <€ SP                  V S4       SP                  V P                  R 4       SP                  V 4       R# r€  r�  r‚  s   &€€€rB   rú  ÚUHTTP11ClientProtocolTests.test_quiescentCallbackCalledEmptyResponse.<locals>.callbackä  r„  rA   rõ   rö   NTr…  ó&   HTTP/1.1 200 OK
Content-length: 0

)r   r(   r“   rþ   r*   rh   rW   r‘   r•   rM   rN   r-  r†  r-   )rS   rú  rj   rG  r˜   r+  s   f   @@rB   Ú)test_quiescentCallbackCalledEmptyResponseÚCHTTP11ClientProtocolTests.test_quiescentCallbackCalledEmptyResponseÝ  sµ   ú€ ð
 ˆ÷	&ô
 $Ó%ˆ	Ü'¨Ó1ˆØ×Ñ 	Ô*à"×*Ñ*Ü�F˜D¤.°$À4ÔHó
ˆð 	×#Ñ# O×$:Ñ$:Ô;Ø×ÑÐUÔVà×Ñœ˜_Ó-¨qÔ1Ø×Ñ˜_¨QÕ/°Ô:Ø×Ñ˜o¨aÕ0´(Ö;rA   c           
     óì  € . p\        4       p\        VP                  4      pVP                  V4       VP	                  \        RR\        RRR7      4      pVP                  R4       . pVP                  VP                  4       V^ ,          p\        4       pVP                  V4       VP                  P                  \        4       V P                  V. 4       V P                  VP                   4       R# )z²
If after a response is done the {HTTP11ClientProtocol} returns a
C{Connection: close} header in the response, the C{quiescentCallback}
is not called and the connection is lost.
rõ   rö   NTr…  s9   HTTP/1.1 200 OK
Content-length: 0
Connection: close

©r   r(   r‘   r“   rþ   r*   rh   r•   rW   r   r)  rE  rL   r.   rM   rÇ   rî  ©rS   r+  rj   r˜   rG  r0  rù   rŒ  s   &       rB   Útest_quiescentCallbackNotCalledÚ9HTTP11ClientProtocolTests.test_quiescentCallbackNotCalled÷  sÒ   € ð ˆÜ#Ó%ˆ	Ü'¨×(>Ñ(>Ó?ˆØ×Ñ 	Ô*à"×*Ñ*Ü�F˜D¤.°$À4ÔHó
ˆð 	×Ñðô	
ð ˆØ×#Ñ# F§M¡MÔ2Ø˜!•9ˆä+Ó-ˆØ×Ñ˜\Ô*Ø×!Ñ!×&Ñ&¤|Ô4Ø×Ñ˜¨"Ô-Ø�‰˜	×/Ñ/Ö0rA   c           
     óì  € . p\        4       p\        VP                  4      pVP                  V4       VP	                  \        RR\        RRR7      4      pVP                  R4       . pVP                  VP                  4       V^ ,          p\        4       pVP                  V4       VP                  P                  \        4       V P                  V. 4       V P                  VP                   4       R# )zˆ
If the request was non-persistent (i.e. sent C{Connection: close}),
the C{quiescentCallback} is not called and the connection is lost.
rõ   rö   NFr…  r™  r�  rž  s   &       rB   Ú1test_quiescentCallbackNotCalledNonPersistentQueryÚKHTTP11ClientProtocolTests.test_quiescentCallbackNotCalledNonPersistentQuery  sÌ   € ð
 ˆÜ#Ó%ˆ	Ü'¨×(>Ñ(>Ó?ˆØ×Ñ 	Ô*à"×*Ñ*Ü�F˜D¤.°$À5ÔIó
ˆð 	×ÑÐUÔVàˆØ×#Ñ# F§M¡MÔ2Ø˜!•9ˆä+Ó-ˆØ×Ñ˜\Ô*Ø×!Ñ!×&Ñ&¤|Ô4Ø×Ñ˜¨"Ô-Ø�‰˜	×/Ñ/Ö0rA   c           
     ó°  € R p\         P                  ! V \        4      p\        4       p\	        V4      pVP                  V4       VP                  \        RR\        RRR7      4      pVP                  R4       . pVP                  VP                  4       V^ ,          p\        4       pVP                  V4       VP                  P                  \         4       V P#                  ^\%        V4      4       V^ ,          p	V	R,          p
V P'                  V
P(                  \*        4       V P-                  \*        4       V P/                  VP0                  4       R# )	z`
If C{quiescentCallback} throws an exception, the error is logged and
protocol is disconnected.
c                 ó   € \        4       hrs   )ÚZeroDivisionError)r%  s   &rB   rú  ÚHHTTP11ClientProtocolTests.test_quiescentCallbackThrows.<locals>.callback5  s   € Ü#Ó%Ð%rA   rõ   rö   NTr…  r™  rƒ  )r   r„  r   r   r(   r“   rþ   r*   rh   r•   rW   r‘   r   r)  rE  rL   r.   r…  rN   r†  r®   r¦  r‡  rÇ   rî  )rS   rú  rˆ  rj   r˜   rG  r0  rù   rŒ  r‰  rî   s   &          rB   Útest_quiescentCallbackThrowsÚ6HTTP11ClientProtocolTests.test_quiescentCallbackThrows/  s  € ò	&ô +×<Ò<¸TÔCUÓVˆä#Ó%ˆ	Ü'¨Ó1ˆØ×Ñ 	Ô*à"×*Ñ*Ü�F˜D¤.°$À4ÔHó
ˆð 	×ÑÐUÔVàˆØ×#Ñ# F§M¡MÔ2Ø˜!•9ˆÜ+Ó-ˆØ×Ñ˜\Ô*Ø×!Ñ!×&Ñ&¤|Ô4à×Ñ˜!œS Ó-Ô.Ø˜A•ˆØ�-Õ ˆØ×Ñ˜aŸg™gÔ'8Ô9à×ÑÔ0Ô1Ø�‰˜	×/Ñ/Ö0rA   c                ó  € \        4       p\        4       pVP                  V4       VP                  \	        RR\
        R4      4      pVP                  4        V P                  VP                  4       \        W\        \        .4      # )zà
The L{Deferred} returned by L{HTTP11ClientProtocol.request} will fire
with a L{ResponseNeverReceived} failure containing a L{CancelledError}
exception if the request was cancelled before any response headers were
received.
rõ   rö   N)r   r(   r“   rþ   r*   rh   ÚcancelrÇ   Údisconnectedr[   r0   r   re  s   &   rB   Útest_cancelBeforeResponseÚ3HTTP11ClientProtocolTests.test_cancelBeforeResponseR  sp   € ô $Ó%ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø×!Ñ!¤'¨&°$¼ÈÓ"MÓNˆØ�‰ŒØ�‰˜	×.Ñ.Ô/Ü*ØÔ/´.Ð1Aó
ð 	
rA   c                ó(  € \        4       p\        4       pVP                  V4       VP                  \	        RR\
        R4      4      pVP                  R4       VP                  4        V P                  VP                  4       \        W\        .4      # )zÙ
The L{Deferred} returned by L{HTTP11ClientProtocol.request} will fire
with a L{ResponseFailed} failure containing a L{CancelledError}
exception if the request was cancelled before all response headers were
received.
rõ   rö   Nr÷   )r   r(   r“   rþ   r*   rh   r•   r«  rÇ   r¬  r^   r   re  s   &   rB   Útest_cancelDuringResponseÚ3HTTP11ClientProtocolTests.test_cancelDuringResponsec  sw   € ô $Ó%ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø×!Ñ!¤'¨&°$¼ÈÓ"MÓNˆØ×ÑÐ4Ô5Ø�‰ŒØ�‰˜	×.Ñ.Ô/Ü# D´>Ð2BÓCÐCrA   c                ó¸  aaa€ \        4       p\        4       pVP                  V4       \        V4      oRR/oV3R loVV3R lpVSn        VP                  \        RR\        S4      4      pSP                  P                  R4       VP                  4        V P                  VP                  4       V P                  SR,          4       \        W\        .4      # )zè
The L{Deferred} returned by L{HTTP11ClientProtocol.request} will fire
with a L{RequestGenerationFailed} failure containing a
L{CancelledError} exception if the request was cancelled before a
C{bodyProducer} has finished producing.
Ú	cancelledFc                 ó   <€ R SR&   R# )Tr³  Nr9   )r�  ÚnonLocals   &€rB   r«  ÚJHTTP11ClientProtocolTests.assertCancelDuringBodyProduction.<locals>.cancel�  s   ø€ Ø$(ˆH�[Ó!rA   c                 óJ   <€ V Sn         \        S4      Sn        SP                  # rs   ©Úconsumerr   r  )r¹  r«  Úproducers   &€€rB   ÚstartProducingÚRHTTP11ClientProtocolTests.assertCancelDuringBodyProduction.<locals>.startProducing„  s$   ø€ Ø (ˆHÔÜ (¨Ó 0ˆHÔØ×$Ñ$Ð$rA   ó   POSTó   /bars   xxxxx)r   r(   r“   ÚStringProducerr»  rþ   r*   rh   r¹  rË  r«  rÇ   r¬  r`   r   )	rS   ÚproducerLengthrj   r˜   r»  r0  r«  rµ  rº  s	   &&    @@@rB   Ú assertCancelDuringBodyProductionÚ:HTTP11ClientProtocolTests.assertCancelDuringBodyProductions  s¶   ú€ ô $Ó%ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ü! .Ó1ˆà Ð'ˆõ	)ö	%ð
 #1ˆÔà×!Ñ!¤'¨'°7¼NÈHÓ"UÓVˆØ×Ñ×Ñ Ô)Ø�‰ŒØ�‰˜	×.Ñ.Ô/Ø�‰˜ Õ-Ô.Ü,¨T¼NÐ;KÓLÐLrA   c                ó$   € V P                  ^
4      # )a   
The L{Deferred} returned by L{HTTP11ClientProtocol.request} will fire
with a L{RequestGenerationFailed} failure containing a
L{CancelledError} exception if the request was cancelled before a
C{bodyProducer} with an explicit length has finished producing.
)rÁ  rt   s   &rB   Útest_cancelDuringBodyProductionÚ9HTTP11ClientProtocolTests.test_cancelDuringBodyProduction’  s   € ð ×4Ñ4°RÓ8Ð8rA   c                ó,   € V P                  \        4      # )zÿ
The L{Deferred} returned by L{HTTP11ClientProtocol.request} will fire
with a L{RequestGenerationFailed} failure containing a
L{CancelledError} exception if the request was cancelled before a
C{bodyProducer} with C{UNKNOWN_LENGTH} has finished producing.
)rÁ  r   rt   s   &rB   Ú&test_cancelDuringChunkedBodyProductionÚ@HTTP11ClientProtocolTests.test_cancelDuringChunkedBodyProduction›  s   € ð ×4Ñ4´^ÓDÐDrA   )r˜   rj   rs   )*r;   r<   r=   r>   r?   rÐ  rÓ  rß  rä  rð  r÷  rþ  r  r  r  r  r  r3  r8  rA  rH  rL  rP  rV  r\  rb  rf  ri  r|  r�  r”  rš  rŸ  r¢  r¨  r­  r°  rÁ  rÄ  rÇ  r@   r‚   rƒ   s   @rB   rÎ  rÎ  <  sÑ   ø‡ € ñò
5ò@òòòò4Lô ò@KòJò
ò0ò.ò$0òd?ò4ò@'òR6ò:
ò@ò8Mò%ò*=òGò 80òt7;òr,?ò\<ò41ò>1ò2!1òF
ò"Dò Mò>9÷Eð ErA   rÎ  c                   óF   a € ] tR tRt o RtRtR tR tR tR t	R t
R	tV tR
# )r¿  i¥  a—  
L{StringProducer} is a dummy body producer.

@ivar stopped: A flag which indicates whether or not C{stopProducing} has
    been called.
@ivar consumer: After C{startProducing} is called, the value of the
    C{consumer} argument to that method.
@ivar finished: After C{startProducing} is called, a L{Deferred} which was
    returned by that method.  L{StringProducer} will never fire this
    L{Deferred}.
Fc                ó   € Wn         R # rs   )r  )rS   r  s   &&rB   Ú__init__ÚStringProducer.__init__µ  s   € ØŽrA   c                óD   € Wn         \        4       V n        V P                  # rs   r¸  )rS   r¹  s   &&rB   r»  ÚStringProducer.startProducing¸  s   € Ø ŒÜ ›
ˆŒØ�}‰}ÐrA   c                ó   € R V n         R# r¿  rÀ  rt   s   &rB   ÚstopProducingÚStringProducer.stopProducing½  rÄ  rA   c                ó   € R # rs   r9   rt   s   &rB   ÚpauseProducingÚStringProducer.pauseProducingÀ  ó   € árA   c                ó   € R # rs   r9   rt   s   &rB   ÚresumeProducingÚStringProducer.resumeProducingÄ  rÕ  rA   )r¹  r  r  rÁ  N)r;   r<   r=   r>   r?   rÁ  rË  r»  rÐ  rÓ  r×  r@   r‚   rƒ   s   @rB   r¿  r¿  ¥  s/   ø‡ € ñ
ð €Gòòò
ò÷ð rA   r¿  c                   ó¾   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tRR ltR tR tR tR tR tRtV tR# )ÚRequestTestsiÉ  z
Tests for L{Request}.
c                ó$   € \        4       V n        R # rs   )r   rj   rt   s   &rB   rÐ  ÚRequestTests.setUpÎ  s   € Ü(Ó*ˆŽrA   c                ó°   € \        RR\        R4      P                  V P                  4       V P	                  V P                  P                  4       R4       R# )zS
L{Request.writeTo} formats the request data and writes it to the given
transport.
rõ   rö   Ns8   GET / HTTP/1.1
Connection: close
Host: example.com

©r*   rh   r¼  rj   rM   r®   rt   s   &rB   Útest_sendSimplestRequestÚ%RequestTests.test_sendSimplestRequestÑ  sD   € ô
 	�˜œn¨dÓ3×;Ñ;¸D¿N¹NÔKØ×ÑØ�N‰N× Ñ Ó"ðö	
rA   c                ó¸   € \        RR\        RRR7      pVP                  V P                  4       V P	                  V P                  P                  4       R4       R# )z?
A pesistent request does not send 'Connection: close' header.
rõ   rö   NTr…  s%   GET / HTTP/1.1
Host: example.com

rÞ  )rS   Úreqs   & rB   Ú"test_sendSimplestPersistentRequestÚ/RequestTests.test_sendSimplestPersistentRequestß  sG   € ô �f˜d¤N°DÀTÔJˆØ�‰�D—N‘NÔ#Ø×ÑØ�N‰N× Ñ Ó"ØBö	
rA   c                ó‚  € \        RRR.RR./4      p\        RRVR4      P                  V P                  4       V P                  P	                  4       P                  R	4      pV P                  V^ ,          R
4       V P                  VRR RR.4       V^  VRR1 VP                  4        V P                  V. RO4       R# )zN
L{Request.writeTo} formats header data and writes it to the given
transport.
r*  r¤   r½   rE   rF   rõ   ó   /fooNrÜ   ó   GET /foo HTTP/1.1rA   éþÿÿÿ)ó   Connection: closes   Host: example.comr©   r¼   )r2   r*   r¼  rj   r®   ÚsplitrM   Úsort)rS   r¿   Úliness   &  rB   Útest_sendRequestHeadersÚ$RequestTests.test_sendRequestHeadersê  s´   € ô
 ˜8 f¨fÐ%5°wÀÐ@PÐQÓRˆÜ�˜ ¨$Ó/×7Ñ7¸¿¹ÔGØ—‘×$Ñ$Ó&×,Ñ,¨WÓ5ˆØ×Ñ˜˜q�Ð#7Ô8Ø×Ñ˜˜r˜s˜ c¨3 ZÔ0Ø�!ˆH�e˜B™C�jØ�
‰
ŒØ×ÑØÚVö	
rA   c                ó¾  € \          FÒ  p\        RV.RR./4      p\        4       p\        RRVR4      P	                  V4       VP                  4       P                  R4      pV P                  V^ ,          R4       V P                  VRR R	R	.4       V^  VRR1 VP                  R
4       VP                  R4       V P                  VR\        ,           .4       KÔ  	  R# )zM
Linear whitespace in request header values is replaced with a
single space.
r*  rE   s   example.invalidrõ   ræ  NrÜ   rç  rA   ré  s   Host: example.invalids   X-Foo: rè  )
r5   r2   r   r*   r¼  r®   rê  rM   Úremover6   )rS   Ú	componentr¿   rj   rì  s   &    rB   Ú-test_sanitizeLinearWhitespaceInRequestHeadersÚ:RequestTests.test_sanitizeLinearWhitespaceInRequestHeadersû  sÏ   € ÷
 9ˆIÜ˜x¨)¨°gÐ@RÐ?SÐTÓUˆGÜ'Ó)ˆIÜ�F˜G W¨dÓ3×;Ñ;¸IÔFØ—O‘OÓ%×+Ñ+¨GÓ4ˆEØ×Ñ˜U 1�XÐ';Ô<Ø×Ñ˜U 2 3˜Z¨#¨s¨Ô4Ø�a�˜% ¡˜*Ø�L‰LÐ-Ô.Ø�L‰LÐ1Ô2Ø×Ñ˜U Z´.Õ%@Ð$AÖBó 9rA   c                ó  € \        \        4      p\        RR\        V4      pVP	                  V P
                  4       V P                  VP                  R4       V P                  V P
                  P                  V4       V P                  V P
                  P                  4       V P                  V P
                  P                  4       R4       V P
                  P                  4        VP                  P                  R4       VP                  P                  R4       VP                   P#                  R4       V P                  V P
                  P                  R4       V P                  V P
                  P                  4       R4       R# )z«
L{Request.writeTo} uses chunked encoding to write data from the request
body producer to the given transport.  It registers the request body
producer with the transport.
r½  r¾  NsX   POST /bar HTTP/1.1
Connection: close
Transfer-Encoding: chunked
Host: example.com

s!   3
xxx
f
yyyyyyyyyyyyyyy
0

s   xxxs   yyyyyyyyyyyyyyy)r¿  r   r*   rh   r¼  rj   ÚassertNotIdenticalr¹  r-  rº  rÇ   Ú	streamingrM   r®   ÚclearrË  r  rú  ©rS   rº  rþ   s   &  rB   Útest_sendChunkedRequestBodyÚ(RequestTests.test_sendChunkedRequestBody  s   € ô "¤.Ó1ˆÜ˜' 7¬N¸HÓEˆØ�‰˜Ÿ™Ô'à×Ñ × 1Ñ 1°4Ô8Ø×Ñ˜TŸ^™^×4Ñ4°hÔ?Ø�‰˜Ÿ™×0Ñ0Ô1à×ÑØ�N‰N× Ñ Ó"ðô	
ð 	�‰×ÑÔà×Ñ×Ñ Ô)Ø×Ñ×Ñ 	Ô*Ø×Ñ×"Ñ" 4Ô(Ø×Ñ˜TŸ^™^×4Ñ4°dÔ;Ø×ÑØ�N‰N× Ñ Ó"ØPö	
rA   c                óT  a € \        \        4      p\        RR\        V4      pVP	                  S P
                  4      pS P
                  P                  4        VP                  P                  \        4       4       V 3R lpS P                  V\        4      pVP                  V4       V# )ab  
If L{Request} is created with a C{bodyProducer} without a known length
and the L{Deferred} returned from its C{startProducing} method fires
with a L{Failure}, the L{Deferred} returned by L{Request.writeTo} fires
with that L{Failure} and the body producer is unregistered from the
transport.  The final zero-length chunk is not written to the
transport.
r½  r¾  c                 ó¨   <€ SP                  SP                  P                  4       R 4       SP                  SP                  P                  R4       R# r×  )rM   rj   r®   r-  rº  rÙ  s   &€rB   rT   ÚCRequestTests.test_sendChunkedRequestBodyWithError.<locals>.cbFailed<  s:   ø€ Ø×Ñ˜TŸ^™^×1Ñ1Ó3°SÔ9Ø× Ñ  §¡×!8Ñ!8¸$Ö?rA   )r¿  r   r*   rh   r¼  rj   r÷  r  rû  r8   rV   rW   )rS   rº  rþ   ÚwriteDeferredrT   rZ   s   f     rB   Ú$test_sendChunkedRequestBodyWithErrorÚ1RequestTests.test_sendChunkedRequestBodyWithError-  s…   ø€ ô "¤.Ó1ˆÜ˜' 7¬N¸HÓEˆØŸ™¨¯©Ó7ˆØ�‰×ÑÔØ×Ñ×!Ñ!Ô"4Ó"6Ô7õ	@ð ×Ñ˜}Ô.@ÓAˆØ	�‰�hÔØˆrA   c                óØ  € \        ^4      p\        RR\        V4      pVP                  V P                  4       V P                  VP                  R4       V P                  V P                  P                  V4       V P                  V P                  P                  4       V P                  V P                  P                  4       R4       V P                  P                  4        VP                  P                  R4       VP                  P!                  R4       V P                  V P                  P                  R4       V P                  V P                  P                  4       R4       R# )zª
If L{Request} is created with a C{bodyProducer} with a known length,
that length is sent as the value for the I{Content-Length} header and
chunked encoding is not used.
r½  r¾  NsO   POST /bar HTTP/1.1
Connection: close
Content-Length: 3
Host: example.com

ru  )r¿  r*   rh   r¼  rj   rõ  r¹  r-  rº  rÇ   rö  rM   r®   r÷  rË  r  rú  rø  s   &  rB   Útest_sendRequestBodyWithLengthÚ+RequestTests.test_sendRequestBodyWithLengthD  s  € ô " !Ó$ˆÜ˜' 7¬N¸HÓEˆØ�‰˜Ÿ™Ô'à×Ñ × 1Ñ 1°4Ô8Ø×Ñ˜TŸ^™^×4Ñ4°hÔ?Ø�‰˜Ÿ™×0Ñ0Ô1à×ÑØ�N‰N× Ñ Ó"ðô	
ð 	�‰×ÑÔà×Ñ×Ñ Ô'Ø×Ñ×"Ñ" 4Ô(Ø×Ñ˜TŸ^™^×4Ñ4°dÔ;Ø×Ñ˜Ÿ™×-Ñ-Ó/°Ö8rA   c                óÂ   € \        VR\        R4      pVP                  V P                  4       V P	                  V P                  P                  4       VR,           4       R# )zò
Verify that the message generated by a L{Request} initialized with
the given method and C{None} as the C{bodyProducer} includes
I{Content-Length: 0} in the header.

@param method: The HTTP method issue in the request.
@type method: L{bytes}
ræ  NsK    /foo HTTP/1.1
Connection: close
Content-Length: 0
Host: example.com

rÞ  )rS   rÅ  rþ   s   && rB   Ú_sendRequestEmptyBodyWithLengthÚ,RequestTests._sendRequestEmptyBodyWithLengtha  sO   € ô ˜& '¬>¸4Ó@ˆØ�‰˜Ÿ™Ô'à×ÑØ�N‰N× Ñ Ó"Øð õ ö	
rA   c                ó(   € V P                  R4       R# )z�
If I{PUT} L{Request} is created without a C{bodyProducer},
I{Content-Length: 0} is included in the header and chunked
encoding is not used.
s   PUTN©r  rt   s   &rB   Útest_sendPUTRequestEmptyBodyÚ)RequestTests.test_sendPUTRequestEmptyBodyv  s   € ð 	×,Ñ,¨VÖ4rA   c                ó(   € V P                  R4       R# )zŽ
If I{POST} L{Request} is created without a C{bodyProducer},
I{Content-Length: 0} is included in the header and chunked
encoding is not used.
r½  Nr  rt   s   &rB   Útest_sendPOSTRequestEmptyBodyÚ*RequestTests.test_sendPOSTRequestEmptyBody~  s   € ð 	×,Ñ,¨WÖ5rA   c                óV  € \        ^4      p\        RR\        V4      pVP                  V P                  4      pVP
                  P                  R4       VP                  P                  R4       V P                  V P                  P                  R4       V P                  V\        4      # )zè
If L{Request} is created with a C{bodyProducer} with a known length and
the producer does not produce that many bytes, the L{Deferred} returned
by L{Request.writeTo} fires with a L{Failure} wrapping a
L{WrongBodyLength} exception.
r½  r¾  ó   abN)r¿  r*   rh   r¼  rj   r¹  rË  r  rú  r-  rº  rV   r&   ©rS   rº  rþ   rþ  s   &   rB   Ú#test_sendRequestBodyWithTooFewBytesÚ0RequestTests.test_sendRequestBodyWithTooFewBytes†  s…   € ô " !Ó$ˆÜ˜' 7¬N¸HÓEˆØŸ™¨¯©Ó7ˆØ×Ñ×Ñ Ô&Ø×Ñ×"Ñ" 4Ô(Ø×Ñ˜TŸ^™^×4Ñ4°dÔ;Ø×!Ñ! -´ÓAÐArA   c                óþ  a aa€ \        ^4      o\        RR\        S4      pVP                  S P                  4      pSP
                  P                  R4       S P                  SP                  4       SP
                  P                  R4       S P                  SP                  4       S P                  S P                  P                  R4       VVV 3R lpS P                  V\        4      pVP                  V4       V# )aï  
Verify that when too many bytes have been written by a body producer
and then the body producer's C{startProducing} L{Deferred} fires that
the producer is unregistered from the transport and that the
L{Deferred} returned from L{Request.writeTo} is fired with a L{Failure}
wrapping a L{WrongBodyLength}.

@param finisher: A callable which will be invoked with the body
    producer after too many bytes have been written to the transport.
    It should fire the startProducing Deferred somehow.
r½  r¾  r  ó   cdNc                 óJ  <€ SP                  SP                  P                  4       R 4       SP                  P                  4        SP	                  \
        SP                  P                  R4       S! S4       SP                  SP                  P                  4       R4       R# )sQ   POST /bar HTTP/1.1
Connection: close
Content-Length: 3
Host: example.com

abs   efrA   N)rM   rj   r®   r÷  rˆ   r   r¹  rË  )rì   Úfinisherrº  rS   s   &€€€rB   rT   ÚCRequestTests._sendRequestBodyWithTooManyBytesTest.<locals>.cbFailedµ  sƒ   ø€ ð ×ÑØ—‘×$Ñ$Ó&ðôð �N‰N× Ñ Ô"ð ×Ñœk¨8×+<Ñ+<×+BÑ+BÀEÔJñ
 �XÔð ×Ñ˜TŸ^™^×1Ñ1Ó3°SÖ9rA   )r¿  r*   rh   r¼  rj   r¹  rË  rÉ   rÁ  rÇ   r-  rº  rV   r&   rW   )rS   r  rþ   rþ  rT   rZ   rº  s   ff    @rB   Ú$_sendRequestBodyWithTooManyBytesTestÚ1RequestTests._sendRequestBodyWithTooManyBytesTest•  sÉ   ú€ ô " !Ó$ˆÜ˜' 7¬N¸HÓEˆØŸ™¨¯©Ó7ˆà×Ñ×Ñ Ô&ð 	×Ñ˜×)Ñ)Ô*à×Ñ×Ñ Ô&ð 	�‰˜×(Ñ(Ô)ð 	×Ñ˜TŸ^™^×4Ñ4°dÔ;÷	:ð: ×Ñ˜}¬oÓ>ˆØ	�‰�hÔØˆrA   c                ó*   € R pV P                  V4      # )úò
If L{Request} is created with a C{bodyProducer} with a known length and
the producer tries to produce more than than many bytes, the
L{Deferred} returned by L{Request.writeTo} fires with a L{Failure}
wrapping a L{WrongBodyLength} exception.
c                 ó<   € V P                   P                  R 4       R # rs   ©r  rú  ©rº  s   &rB   r  ÚCRequestTests.test_sendRequestBodyWithTooManyBytes.<locals>.finisherÞ  ó   € Ø×Ñ×&Ñ& tÖ,rA   )r  ©rS   r  s   & rB   Ú$test_sendRequestBodyWithTooManyBytesÚ1RequestTests.test_sendRequestBodyWithTooManyBytesÖ  s   € ò	-ð ×8Ñ8¸ÓBÐBrA   c                ól   a a€ \         P                  ! S \        4      oVV 3R lpS P                  V4      # )r  c                 ó6  <€ V P                   P                  \        4       4       S^ ,          pSP                  RV4       VR,          pSP	                  VP
                  \        4       SP                  \        4      pSP                  \        V4      ^4       R# )rT  rƒ  N)	r  rû  r8   r
  r†  r®   r‡  rM   rN   )rº  r‰  rî   rý  rˆ  rS   s   &   €€rB   r  ÚHRequestTests.test_sendRequestBodyErrorWithTooManyBytes.<locals>.finisherì  sv   ø€ Ø×Ñ×%Ñ%Ô&8Ó&:Ô;Ø •NˆEØ�M‰M˜-¨Ô/Ø�mÕ$ˆAØ×!Ñ! !§'¡'Ô+=Ô>Ø×+Ñ+Ô,>Ó?ˆFØ×ÑœS ›[¨!Ö,rA   )r   r„  r   r  )rS   r  rˆ  s   f @rB   Ú)test_sendRequestBodyErrorWithTooManyBytesÚ6RequestTests.test_sendRequestBodyErrorWithTooManyBytesã  s0   ù€ ô +×<Ò<¸TÔCUÓVˆö	-ð ×8Ñ8¸ÓBÐBrA   c                óZ  € \         P                  ! V \        4      p\        ^4      p\	        RR\
        V4      pVP                  V P                  4       VP                  P                  pVP                  P                  R4       VP                  P                  R4       VP                  \        4       4       V^ ,          pV P                  RV4       VR,          pV P!                  VP"                  \        4       V P%                  \'        V P)                  \        4      4      ^4       R# )aZ  
Though there should be no way for the internal C{finishedConsuming}
L{Deferred} in L{Request._writeToBodyProducerContentLength} to fire a
L{Failure} after the C{finishedProducing} L{Deferred} has fired, in
case this does happen, the error should be logged with a message about
how there's probably a bug in L{Request}.

This is a whitebox test.
r½  r¾  ru  Nrƒ  )r   r„  r   r¿  r*   rh   r¼  rj   r¹  Ú	_finishedrË  r  rú  rû  r8   r
  r†  r®   rM   rN   r‡  )rS   rˆ  rº  rþ   ÚfinishedConsumingr‰  rî   s   &      rB   Ú*test_sendRequestBodyErrorWithConsumerErrorÚ7RequestTests.test_sendRequestBodyErrorWithConsumerError÷  sä   € ô +×<Ò<¸TÔCUÓVˆÜ! !Ó$ˆÜ˜' 7¬N¸HÓEˆØ�‰˜Ÿ™Ô'à$×-Ñ-×7Ñ7Ðà×Ñ×Ñ Ô'Ø×Ñ×"Ñ" 4Ô(à×!Ñ!Ô"4Ó"6Ô7Ø˜A•ˆØ�‰�m UÔ+Ø�-Õ ˆØ×Ñ˜aŸg™gÔ'9Ô:Ø×Ñœ˜T×3Ñ3Ô4FÓGÓHÈ!ÖLrA   c                óæ  € \        ^4      p\        RR\        V4      pVP                  V P                  4      pVP
                  P                  R4       V! V4       V P                  V P                  P                  R4       V P                  P                  4        V P                  \        VP
                  P                  R4       V P                  V P                  P                  4       R4       V# )z÷
Verify that if the body producer fires its Deferred and then keeps
writing to the consumer that the extra writes are ignored and the
L{Deferred} returned by L{Request.writeTo} fires with a L{Failure}
wrapping the most appropriate exception type.
r½  r¾  r  Nr  rA   )r¿  r*   rh   r¼  rj   r¹  rË  r-  rº  r÷  rˆ   r   rM   r®   )rS   r  rº  rþ   rþ  s   &&   rB   Ú-_sendRequestBodyFinishedEarlyThenTooManyBytesÚ:RequestTests._sendRequestBodyFinishedEarlyThenTooManyBytes	  s·   € ô " !Ó$ˆÜ˜' 7¬N¸HÓEˆØŸ™¨¯©Ó7ˆà×Ñ×Ñ Ô&Ù�ÔØ×Ñ˜TŸ^™^×4Ñ4°dÔ;Ø�‰×ÑÔØ×Ñœ+ x×'8Ñ'8×'>Ñ'>ÀÔFØ×Ñ˜Ÿ™×-Ñ-Ó/°Ô5ØÐrA   c                óR   € R pV P                  V P                  V4      \        4      # )a  
If the request body producer indicates it is done by firing the
L{Deferred} returned from its C{startProducing} method but then goes on
to write too many bytes, the L{Deferred} returned by {Request.writeTo}
fires with a L{Failure} wrapping L{WrongBodyLength}.
c                 ó<   € V P                   P                  R 4       R # rs   r  r  s   &rB   r  ÚPRequestTests.test_sendRequestBodyFinishedEarlyThenTooManyBytes.<locals>.finisher-	  r   rA   )rV   r/  r&   r!  s   & rB   Ú1test_sendRequestBodyFinishedEarlyThenTooManyBytesÚ>RequestTests.test_sendRequestBodyFinishedEarlyThenTooManyBytes%	  s-   € ò	-ð ×!Ñ!Ø×>Ñ>¸xÓHÜó
ð 	
rA   c                óR   € R pV P                  V P                  V4      \        4      # )a  
If the request body producer indicates an error by firing the
L{Deferred} returned from its C{startProducing} method but then goes on
to write too many bytes, the L{Deferred} returned by {Request.writeTo}
fires with that L{Failure} and L{WrongBodyLength} is logged.
c                 óL   € V P                   P                  \        4       4       R # rs   )r  rû  r8   r  s   &rB   r  ÚORequestTests.test_sendRequestBodyErroredEarlyThenTooManyBytes.<locals>.finisher=	  s   € Ø×Ñ×%Ñ%Ô&8Ó&:Ö;rA   )rV   r/  r8   r!  s   & rB   Ú0test_sendRequestBodyErroredEarlyThenTooManyBytesÚ=RequestTests.test_sendRequestBodyErroredEarlyThenTooManyBytes5	  s-   € ò	<ð ×!Ñ!Ø×>Ñ>¸xÓHÜó
ð 	
rA   Nc                ó’  € \        \        4      p\        RR\        V4      pVP	                  V P
                  4      pVP                  P                  V4       V P
                  P                  4        V P                  \        VP                  P                  R4       V P                  V P
                  P                  4       R4       V# )zê
If the request body producer with an unknown length tries to write
after firing the L{Deferred} returned by its C{startProducing} method,
the C{write} call raises an exception and does not write anything to
the underlying transport.
r½  r¾  rñ   rA   )r¿  r   r*   rh   r¼  rj   r  rú  r÷  rˆ   r   r¹  rË  rM   r®   )rS   Ú_withrº  rþ   rþ  s   &&   rB   Ú0test_sendChunkedRequestBodyFinishedThenWriteMoreÚ=RequestTests.test_sendChunkedRequestBodyFinishedThenWriteMoreE	  s•   € ô "¤.Ó1ˆÜ˜' 7¬N¸HÓEˆØŸ™¨¯©Ó7ˆØ×Ñ×"Ñ" 5Ô)Ø�‰×ÑÔà×Ñœ+ x×'8Ñ'8×'>Ñ'>ÀÔGØ×Ñ˜Ÿ™×-Ñ-Ó/°Ô5ØÐrA   c                ór   € V P                  \        \        4       4      4      pV P                  V\        4      # )zü
If the request body producer with an unknown length tries to write
after firing the L{Deferred} returned by its C{startProducing} method
with a L{Failure}, the C{write} call raises an exception and does not
write anything to the underlying transport.
)r=  r   r8   rV   )rS   rZ   s   & rB   Ú9test_sendChunkedRequestBodyFinishedWithErrorThenWriteMoreÚFRequestTests.test_sendChunkedRequestBodyFinishedWithErrorThenWriteMoreV	  s6   € ð ×AÑAÜÔ&Ó(Ó)ó
ˆð ×!Ñ! !Ô%7Ó8Ð8rA   c                óö  € \        ^4      p\        RR\        V4      pVP                  V P                  4      pV P                  V P                  P                  V4       V P                  V P                  P                  4       VP                  P                  R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       VP                  P!                  \#        \%        4       4      4       V P                  V P                  P                  4       V P                  V P                  P                  R4       V P'                  V\$        4      # )zÒ
If the L{Deferred} returned from the C{startProducing} method of the
L{IBodyProducer} passed to L{Request} fires with a L{Failure}, the
L{Deferred} returned from L{Request.writeTo} fails with that
L{Failure}.
r½  r¾  r  sQ   POST /bar HTTP/1.1
Connection: close
Content-Length: 5
Host: example.com

abN)r¿  r*   rh   r¼  rj   r-  rº  rÇ   rö  r¹  rË  rM   r®   rÉ   rî  r  rû  r   r8   rV   r  s   &   rB   Útest_sendRequestBodyWithErrorÚ*RequestTests.test_sendRequestBodyWithErrorb	  s  € ô " !Ó$ˆÜ˜' 7¬N¸HÓEˆØŸ™¨¯©Ó7ˆð 	×Ñ˜TŸ^™^×4Ñ4°hÔ?Ø�‰˜Ÿ™×0Ñ0Ô1à×Ñ×Ñ Ô&Ø×ÑØ�N‰N× Ñ Ó"ðô	
ð 	×Ñ˜Ÿ™×5Ñ5Ô6Ø×Ñ×!Ñ!¤'Ô*<Ó*>Ó"?Ô@ð 	×Ñ˜Ÿ™×5Ñ5Ô6ð 	×Ñ˜TŸ^™^×4Ñ4°dÔ;à×!Ñ! -Ô1CÓDÐDrA   c           	     ó¾  € \        RR\        / 4      R4      pV P                  \        VP                  V P
                  4       V P                  V P
                  P                  4       R4       \        RR\        RRR./4      R4      pV P                  \        VP                  V P
                  4       V P                  V P
                  P                  4       R4       R# )z
L{Request.writeTo} raises L{BadHeaders} if there is not exactly one
I{Host} header and writes nothing to the given transport.
rõ   rö   NrA   s   HostrF   s   example.org)r*   r2   rˆ   r   r¼  rj   rM   r®   )rS   rþ   s   & rB   Útest_hostHeaderRequiredÚ$RequestTests.test_hostHeaderRequired‰	  s«   € ô
 ˜& $¬°«°TÓ:ˆØ×Ñœ* g§o¡o°t·~±~ÔFØ×Ñ˜Ÿ™×-Ñ-Ó/°Ô5äØ�Dœ' 7¨^¸^Ð,LÐ"MÓNÐPTó
ˆð 	×Ñœ* g§o¡o°t·~±~ÔFØ×Ñ˜Ÿ™×-Ñ-Ó/°Ö5rA   c                ó  € \        ^4      p\        RR\        V4      pVP                  V P                  4       V P                  VP                  4       VP                  4        V P                  VP                  4       R# )zK
L{Request.stopWriting} calls its body producer's C{stopProducing}
method.
rõ   rö   N)	r¿  r*   rh   r¼  rj   rÉ   rÁ  rÂ  rÇ   rø  s   &  rB   Útest_stopWritingÚRequestTests.test_stopWriting˜	  s`   € ô
 " !Ó$ˆÜ˜& $¬¸ÓAˆØ�‰˜Ÿ™Ô'Ø×Ñ˜×)Ñ)Ô*Ø×ÑÔØ�‰˜×(Ñ(Ö)rA   c                óø  € \         P                  ! V \        4      p\        ^4      pR pW2n        \        RR\        V4      pVP                  V P                  4       VP                  4        V P                  \        V P                  \        4      4      ^4       V P                  ^\        V4      4       V^ ,          pV P                  RV4       VR,          pV P!                  VP"                  \        4       R# )z~
If the body producer's C{stopProducing} method raises an exception,
L{Request.stopWriting} logs it and does not re-raise it.
c                  ó   € \        R 4      h©zstopProducing is bustedr€  r9   rA   rB   ÚbrokenStopProducingÚBRequestTests.test_brokenStopProducing.<locals>.brokenStopProducing¬	  s   € Ü$Ð%>Ó?Ð?rA   rõ   rö   rƒ  N)r   r„  r   r¿  rÐ  r*   rh   r¼  rj   rÂ  rM   rN   r‡  r8   r…  r
  r†  r®   )rS   rˆ  rº  rN  rþ   r‰  rî   s   &      rB   Útest_brokenStopProducingÚ%RequestTests.test_brokenStopProducing¤	  sÇ   € ô
 +×<Ò<¸TÔCUÓVˆÜ! !Ó$ˆò	@ð "5Ôä˜& $¬¸ÓAˆØ�‰˜Ÿ™Ô'Ø×ÑÔØ×Ñœ˜T×3Ñ3Ô4FÓGÓHÈ!ÔLØ×Ñ˜!œS Ó-Ô.Ø˜A•ˆØ�‰�m UÔ+Ø�-Õ ˆØ×Ñ˜aŸg™gÔ'9Ö:rA   ri   rs   ) r;   r<   r=   r>   r?   rÐ  rß  rã  rí  rò  rù  rÿ  r  r  r	  r  r  r  r"  r'  r,  r/  r4  r9  r=  r@  rC  rF  rI  rP  r@   r‚   rƒ   s   @rB   rÚ  rÚ  É  s•   ø‡ € ñò+ò
ò	
ò
ò"Cò"
òBò.9ò:
ò*5ò6òBò?òBCòCò(Mò6ò&
ò 
ô ò"
9ò%EòN6ò
*÷;ð ;rA   rÚ  c                   óX   a € ] tR tRt o RtR tR tR tRR ltR t	R t
R	 tR
 tRtV tR# )ÚLengthEnforcingConsumerTestsi¼	  z'
Tests for L{LengthEnforcingConsumer}.
c                óÂ   € \        4       V n        \        ^
4      V n        \	        4       V n        \        V P                  V P
                  V P                  4      V n        R# )é
   N)r   r0  r¿  rº  r   rj   r"   Úenforcerrt   s   &rB   rÐ  Ú"LengthEnforcingConsumerTests.setUpÁ	  s@   € Ü“jˆŒÜ& rÓ*ˆŒÜ(Ó*ˆŒÜ/Ø�M‰M˜4Ÿ>™>¨4¯;©;ó
ˆŽrA   c                óN  € V P                   P                  R4       V P                  V P                  P	                  4       R4       V P                  P                  4        V P                   P                  R4       V P                  V P                  P	                  4       R4       R# )zÌ
L{LengthEnforcingConsumer.write} calls the wrapped consumer's C{write}
method with the bytes it is passed as long as there are fewer of them
than the C{length} attribute indicates remain to be received.
ru  s   defN)rV  rË  rM   rj   r®   r÷  rt   s   &rB   Ú
test_writeÚ'LengthEnforcingConsumerTests.test_writeÉ	  sr   € ð 	�‰×Ñ˜FÔ#Ø×Ñ˜Ÿ™×-Ñ-Ó/°Ô8Ø�‰×ÑÔØ�‰×Ñ˜FÔ#Ø×Ñ˜Ÿ™×-Ñ-Ó/°Ö8rA   c                ó�   € V P                   P                  R4       V P                  \        V P                   P                  4       R# )z”
L{LengthEnforcingConsumer._noMoreWritesExpected} raises
L{WrongBodyLength} if it is called before the indicated number of bytes
have been written.
Ns	   xxxxxxxxx)rV  rË  rˆ   r&   Ú_noMoreWritesExpectedrt   s   &rB   Útest_finishedEarlyÚ/LengthEnforcingConsumerTests.test_finishedEarlyÕ	  s0   € ð 	�‰×Ñ˜HÔ%Ø×Ñœ/¨4¯=©=×+NÑ+NÖOrA   c                ó†  € V P                   P                  R4       V P                  V P                  P                  4       V P                   P                  R4       V P                  V P                  P                  4       V'       d   V P                   P                  4        V P                  V P                  \        4      # )a  
If it is called with a total number of bytes exceeding the indicated
limit passed to L{LengthEnforcingConsumer.__init__},
L{LengthEnforcingConsumer.write} fires the L{Deferred} with a
L{Failure} wrapping a L{WrongBodyLength} and also calls the
C{stopProducing} method of the producer.
ó   xó
   xxxxxxxxxx)
rV  rË  rÉ   rº  rÁ  rÇ   r\  rV   r0  r&   )rS   Ú_unregisterAfters   &&rB   Útest_writeTooManyÚ.LengthEnforcingConsumerTests.test_writeTooManyÞ	  s€   € ð 	�‰×Ñ˜IÔ&Ø×Ñ˜Ÿ™×.Ñ.Ô/Ø�‰×Ñ˜DÔ!Ø�‰˜Ÿ™×-Ñ-Ô.ßØ�M‰M×/Ñ/Ô1Ø×!Ñ! $§+¡+¬Ó?Ð?rA   c                óZ  € V P                   P                  R4       V P                   P                  4        V P                  V P                  P
                  4       V P                  \        V P                   P                  R4       V P                  V P                  P
                  4       R# )z²
If L{LengthEnforcingConsumer.write} is called after
L{LengthEnforcingConsumer._noMoreWritesExpected}, it calls the
producer's C{stopProducing} method and raises L{ExcessWrite}.
r`  Nra  )	rV  rË  r\  rÉ   rº  rÁ  rˆ   r   rÇ   rt   s   &rB   Útest_writeAfterNoMoreExpectedÚ:LengthEnforcingConsumerTests.test_writeAfterNoMoreExpectedî	  sp   € ð 	�‰×Ñ˜IÔ&Ø�‰×+Ñ+Ô-Ø×Ñ˜Ÿ™×.Ñ.Ô/Ø×Ñœ+ t§}¡}×':Ñ':¸DÔAØ�‰˜Ÿ™×-Ñ-Ö.rA   c                ó$   € V P                  R4      # )z­
L{LengthEnforcingConsumer._noMoreWritesExpected} does nothing (in
particular, it does not raise any exception) if called after too many
bytes have been passed to C{write}.
T)rc  rt   s   &rB   Útest_finishedLateÚ.LengthEnforcingConsumerTests.test_finishedLateú	  s   € ð ×%Ñ% dÓ+Ð+rA   c                ó�   € V P                   P                  R4       V P                  V P                   P                  4       R4       R# )z‡
If L{LengthEnforcingConsumer._noMoreWritesExpected} is called after
the correct number of bytes have been written it returns L{None}.
Nra  )rV  rË  r-  r\  rt   s   &rB   Útest_finishedÚ*LengthEnforcingConsumerTests.test_finished
  s3   € ð
 	�‰×Ñ˜IÔ&Ø×Ñ˜TŸ]™]×@Ñ@ÓBÀDÖIrA   c                ó„   a € V 3R lpVS P                   n        V 3R lpS P                  4       pVP                  V4       V# )a  
If L{LengthEnforcingConsumer.write} calls the producer's
C{stopProducing} because too many bytes were written and the
C{stopProducing} method raises an exception, the exception is logged
and the L{LengthEnforcingConsumer} still errbacks the finished
L{Deferred}.
c                  óX   <€ \         P                  S P                  4       \        R 4      hrM  )r¿  rÐ  rº  r8   rt   s   €rB   rN  ÚRLengthEnforcingConsumerTests.test_stopProducingRaises.<locals>.brokenStopProducing
  s!   ø€ Ü×(Ñ(¨¯©Ô7Ü$Ð%>Ó?Ð?rA   c                 ód   <€ SP                  \        SP                  \        4      4      ^4       R# )rg   N)rM   rN   r‡  r8   rÙ  s   &€rB   Ú
cbFinishedÚILengthEnforcingConsumerTests.test_stopProducingRaises.<locals>.cbFinished
  s$   ø€ Ø×ÑœS ×!7Ñ!7Ô8JÓ!KÓLÈaÖPrA   )rº  rÐ  rc  rW   )rS   rN  rr  rZ   s   f   rB   Útest_stopProducingRaisesÚ5LengthEnforcingConsumerTests.test_stopProducingRaises

  s>   ø€ õ	@ð ':ˆ�‰Ô#õ	Qð ×"Ñ"Ó$ˆØ	�‰�jÔ!ØˆrA   )rV  rº  r0  rj   N)F)r;   r<   r=   r>   r?   rÐ  rY  r]  rc  rf  ri  rl  rt  r@   r‚   rƒ   s   @rB   rS  rS  ¼	  s:   ø‡ € ñò
ò
9òPô@ò 
/ò,òJ÷ð rA   rS  c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )ÚRequestBodyConsumerTestsi!
  z”
Tests for L{ChunkedEncoder} which sits between an L{ITransport} and a
request/response body producer and chunked encodes everything written to
it.
c           	     óf   € V P                  \        \        \        \	        4       4      4      4       R# )z3
L{ChunkedEncoder} instances provide L{IConsumer}.
N)rÇ   r   r   r   r   rt   s   &rB   Útest_interfaceÚ'RequestBodyConsumerTests.test_interface(
  s   € ð 	�‰œ¤Y´¼Ó?PÓ0QÓRÖSrA   c                ó  € \        4       p\        V4      pVP                  R4       V P                  VP	                  4       R4       VP                  4        VP                  R4       V P                  VP	                  4       R4       R# )ze
L{ChunkedEncoder.write} writes to the transport the chunked encoded
form of the bytes passed to it.
rñ   rO  Ns   xxxxxxxxxxxxxxxxs   10
xxxxxxxxxxxxxxxx
)r   r   rË  rM   r®   r÷  )rS   rj   Úencoders   &  rB   rY  Ú#RequestBodyConsumerTests.test_write.
  sg   € ô
 $Ó%ˆ	Ü  Ó+ˆØ�‰�fÔØ×Ñ˜Ÿ™Ó*¨OÔ<Ø�‰ÔØ�‰�iÔ Ø×Ñ˜Ÿ™Ó*Ð,KÖLrA   c                ón  € \        4       p\        4       p\        V4      pVP                  VR4       V P	                  VP
                  V4       V P                  VP                  4       VP                  4        V P	                  VP
                  R4       V P                  VP                  4       R4       R# )zÝ
L{ChunkedEncoder.registerProducer} registers the given streaming
producer with its transport and L{ChunkedEncoder.unregisterProducer}
writes a zero-length chunk to its transport and unregisters the
transport's producer.
TNs   0

)r   rÏ   r   ÚregisterProducerr-  rº  rÇ   rö  ÚunregisterProducerrM   r®   )rS   rj   rº  r|  s   &   rB   Útest_producerRegistrationÚ2RequestBodyConsumerTests.test_producerRegistration;
  sŽ   € ô $Ó%ˆ	Ü“8ˆÜ  Ó+ˆØ× Ñ  ¨4Ô0Ø×Ñ˜Y×/Ñ/°Ô:Ø�‰˜	×+Ñ+Ô,Ø×"Ñ"Ô$Ø×Ñ˜Y×/Ñ/°Ô6Ø×Ñ˜Ÿ™Ó*¨LÖ9rA   r9   N)
r;   r<   r=   r>   r?   ry  rY  r�  r@   r‚   rƒ   s   @rB   rw  rw  !
  s    ø‡ € ñòTòM÷:ð :rA   rw  c                   óN   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )ÚTransportProxyProducerTestsiM
  zb
Tests for L{TransportProxyProducer} which proxies the L{IPushProducer}
interface of a transport.
c                óV   € V P                  \        \        \        R4      4      4       R# )z?
L{TransportProxyProducer} instances provide L{IPushProducer}.
N)rÇ   r   r   r%   rt   s   &rB   ry  Ú*TransportProxyProducerTests.test_interfaceS
  s   € ð 	�‰œ¤]Ô4JÈ4Ó4PÓQÖRrA   c                óÀ   € \        4       p\        V4      pV P                  VP                  V4       VP	                  4        V P                  VP                  R4       R# )zf
L{TransportProxyProducer.stopProxying} drops the reference to the
wrapped L{IPushProducer} provider.
N)r   r%   r-  rZ  ÚstopProxying©rS   rj   Úproxys   &  rB   Ú%test_stopProxyingUnreferencesProducerÚATransportProxyProducerTests.test_stopProxyingUnreferencesProducerY
  sJ   € ô
 $Ó%ˆ	Ü& yÓ1ˆØ×Ñ˜UŸ_™_¨iÔ8Ø×ÑÔØ×Ñ˜UŸ_™_¨dÖ3rA   c                óx  € \        4       pVP                  4        \        V4      pV P                  VP                  R4       VP                  4        V P                  VP                  R4       VP                  4        VP                  4        VP                  4        V P                  VP                  R4       R# )z�
L{TransportProxyProducer.resumeProducing} calls the wrapped
transport's C{resumeProducing} method unless told to stop proxying.
rC  r  N)r   rÓ  r%   rM   r  r×  rˆ  r‰  s   &  rB   Útest_resumeProducingÚ0TransportProxyProducerTests.test_resumeProducingd
  s–   € ô
 $Ó%ˆ	Ø× Ñ Ô"ä& yÓ1ˆà×Ñ˜×0Ñ0°(Ô;Ø×ÑÔà×Ñ˜×0Ñ0°+Ô>à× Ñ Ô"Ø×ÑÔð 	×ÑÔØ×Ñ˜×0Ñ0°(Ö;rA   c                óX  € \        4       p\        V4      pV P                  VP                  R4       VP	                  4        V P                  VP                  R4       VP                  4        VP                  4        VP	                  4        V P                  VP                  R4       R# )z
L{TransportProxyProducer.pauseProducing} calls the wrapped transport's
C{pauseProducing} method unless told to stop proxying.
r  rC  N)r   r%   rM   r  rÓ  r×  rˆ  r‰  s   &  rB   Útest_pauseProducingÚ/TransportProxyProducerTests.test_pauseProducingz
  sŠ   € ô
 $Ó%ˆ	ä& yÓ1ˆà×Ñ˜×0Ñ0°+Ô>Ø×ÑÔà×Ñ˜×0Ñ0°(Ô;à×!Ñ!Ô#Ø×ÑÔð 	×ÑÔØ×Ñ˜×0Ñ0°+Ö>rA   c                ób  € \        4       p\        V4      pV P                  VP                  R4       VP	                  4        V P                  VP                  R4       \        4       p\        V4      pVP                  4        VP	                  4        V P                  VP                  R4       R# )z}
L{TransportProxyProducer.stopProducing} calls the wrapped transport's
C{stopProducing} method unless told to stop proxying.
r  rÁ  N)r   r%   rM   r  rÐ  rˆ  r‰  s   &  rB   Útest_stopProducingÚ.TransportProxyProducerTests.test_stopProducing�
  sŽ   € ô
 $Ó%ˆ	Ü& yÓ1ˆà×Ñ˜×0Ñ0°+Ô>Ø×ÑÔà×Ñ˜×0Ñ0°)Ô<ä#Ó%ˆ	Ü& yÓ1ˆØ×ÑÔØ×ÑÔà×Ñ˜×0Ñ0°+Ö>rA   c                ón  € \        4       p\        4       pVP                  V4       W!n        \	        V4      pV P                  VP                  4       V P                  VP                  R4       VP                  4        V P                  VP                  R4       V P                  VP                  4       R# )z[
L{TransportProxyProducer.loseConnection} calls the wrapped transport's
C{loseConnection}.
r  N)r   r   r“   r˜   r%   rÇ   Ú	connectedrM   r  ÚloseConnectionrÉ   ©rS   rj   r˜   rŠ  s   &   rB   Ú test_loseConnectionWhileProxyingÚ<TransportProxyProducerTests.test_loseConnectionWhileProxying£
  s’   € ô
 5Ó6ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø%ÔÜ& yÓ1ˆà�‰˜	×+Ñ+Ô,Ø×Ñ˜×0Ñ0°+Ô>à×ÑÔð 	×Ñ˜×0Ñ0°+Ô>Ø×Ñ˜×,Ñ,Ö-rA   c                ó  € \        4       p\        4       pVP                  V4       W!n        \	        V4      pVP                  4        V P                  VP                  4       VP                  4        V P                  VP                  4       R# )zU
L{TransportProxyProducer.loseConnection} does nothing when the
proxy is not active.
N)	r   r   r“   r˜   r%   rˆ  rÇ   r—  r˜  r™  s   &   rB   Útest_loseConnectionNotProxyingÚ:TransportProxyProducerTests.test_loseConnectionNotProxying¸
  sp   € ô
 5Ó6ˆ	Ü'Ó)ˆØ×Ñ 	Ô*Ø%ÔÜ& yÓ1ˆØ×ÑÔØ�‰˜	×+Ñ+Ô,à×ÑÔð 	�‰˜	×+Ñ+Ö,rA   r9   N)r;   r<   r=   r>   r?   ry  r‹  rŽ  r‘  r”  rš  r�  r@   r‚   rƒ   s   @rB   r„  r„  M
  s3   ø‡ € ñò
Sò	4ò<ò,?ò*?ò(.÷*-ð -rA   r„  c                   ó~   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tRtV tR# )ÚResponseTestsiË
  z
Tests for L{Response}.
c                ój   € \        \        4       4      pV P                  \        \        V4      4       R# )z-
L{Response} instances provide L{IResponse}.
N)rk   r   rÇ   r   r4   ©rS   rù   s   & rB   Útest_verifyInterfaceÚ"ResponseTests.test_verifyInterfaceÐ
  s$   € ô )¬Ó):Ó;ˆØ�‰œ¤Y°Ó9Ö:rA   c                óB  a€ . o\        4       p ! V3R lR\        4      pV! 4       p\        V4      pVP                  V4       Sw  pVP	                  4        V P                  VP                  R4       VP                  4        V P                  VP                  R4       R# )z±
The L{IProtocol} provider passed to L{Response.deliverBody} has its
C{makeConnection} method called with an L{IPushProducer} provider
hooked up to the response as an argument.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú7ResponseTests.test_makeConnection.<locals>.SomeProtocolià
  c                ó*   <€ SP                  V4       R # rs   r  )rS   rº  Ú	producerss   &&€rB   r“   ÚFResponseTests.test_makeConnection.<locals>.SomeProtocol.makeConnectioná
  s   ø€ Ø× Ñ  Ö*rA   r9   N©r;   r<   r=   r>   r“   r@   r‚   )r„   r©  s   @€rB   ÚSomeProtocolr§  à
  s   ù‡ € ÷+ó +rA   r¬  rC  r  N)r   r   rk   r)  rÓ  rM   r  r×  )rS   rj   r¬  r¹  rù   ÚtheProducerr©  s   &     @rB   Útest_makeConnectionÚ!ResponseTests.test_makeConnection×
  sŠ   ø€ ð ˆ	Ü#Ó%ˆ	÷	+œ8ô 	+ñ  “>ˆÜ(¨Ó3ˆØ×Ñ˜XÔ&Ø!‰ˆØ×"Ñ"Ô$Ø×Ñ˜×0Ñ0°(Ô;Ø×#Ñ#Ô%Ø×Ñ˜×0Ñ0°+Ö>rA   c                óÎ   a€ . o ! V3R lR\         4      pV! 4       p\        \        4       4      pVP                  V4       VP	                  R4       V P                  SR.4       R# )z•
The L{IProtocol} provider passed to L{Response.deliverBody} has its
C{dataReceived} method called with bytes received as part of the
response body.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú5ResponseTests.test_dataReceived.<locals>.ListConsumeriõ
  c                ó*   <€ SP                  V4       R # rs   r  ©rS   rê   rÕ   s   &&€rB   r•   ÚBResponseTests.test_dataReceived.<locals>.ListConsumer.dataReceivedö
  ó   ø€ Ø—‘˜TÖ"rA   r9   N©r;   r<   r=   r>   r•   r@   r‚   ©r„   rÕ   s   @€rB   ÚListConsumerr²  õ
  ó   ù‡ € ÷#ó #rA   r¹  rñ   N)r   rk   r   r)  r  rM   )rS   r¹  r¹  rù   rÕ   s   &   @rB   Útest_dataReceivedÚResponseTests.test_dataReceivedí
  sZ   ø€ ð ˆ÷	#œ8ô 	#ñ  “>ˆÜ(¬Ó):Ó;ˆØ×Ñ˜XÔ&à×"Ñ" 6Ô*Ø×Ñ˜  Ö)rA   c                óL  a€ . o ! V3R lR\         4      pV! 4       p\        \        4       4      pVP                  V4       VP	                  4        S^ ,          P                  \        4       V P                  \        S4      ^4       V P                  VP                  R4       R# )zË
The L{IProtocol} provider passed to L{Response.deliverBody} has its
C{connectionLost} method called with a L{Failure} wrapping
L{ResponseDone} when the response's C{_bodyDataFinished} method is
called.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú7ResponseTests.test_connectionLost.<locals>.ListConsumeri	  c                ó*   <€ SP                  V4       R # rs   r  )rS   rP   Úlosts   &&€rB   rq  ÚFResponseTests.test_connectionLost.<locals>.ListConsumer.connectionLost
  s   ø€ Ø—‘˜FÖ#rA   r9   N)r;   r<   r=   r>   rq  r@   r‚   )r„   rÁ  s   @€rB   r¹  r¿  	  s   ù‡ € ÷$ó $rA   r¹  N)r   rk   r   r)  r  rL   r.   rM   rN   r-  Ú_bodyProtocol)rS   r¹  r¹  rù   rÁ  s   &   @rB   Útest_connectionLostÚ!ResponseTests.test_connectionLost   s‚   ø€ ð ˆ÷	$œ8ô 	$ñ  “>ˆÜ(¬Ó):Ó;ˆØ×Ñ˜XÔ&à×"Ñ"Ô$ØˆQ��‰”\Ô"Ø×Ñœ˜T› AÔ&ð 	×Ñ˜X×3Ñ3°TÖ:rA   c                óL  a€ . o ! V3R lR\         4      pV! 4       p\        \        4       4      pVP                  R4       VP                  R4       VP	                  V4       VP                  R4       V P                  S. RO4       V P                  VP                  R4       R# )z¬
If data is delivered to the L{Response} before a protocol is registered
with C{deliverBody}, that data is buffered until the protocol is
registered and then is delivered.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú8ResponseTests.test_bufferEarlyData.<locals>.ListConsumeri!  c                ó*   <€ SP                  V4       R # rs   r  r´  s   &&€rB   r•   ÚEResponseTests.test_bufferEarlyData.<locals>.ListConsumer.dataReceived"  r¶  rA   r9   Nr·  r¸  s   @€rB   r¹  rÈ  !  rº  rA   r¹  rñ   r¤   r½   N)rñ   r¤   r½   )r   rk   r   r  r)  rM   r-  Ú_bodyBuffer)rS   r¹  r˜   rù   rÕ   s   &   @rB   Útest_bufferEarlyDataÚ"ResponseTests.test_bufferEarlyData  s�   ø€ ð ˆ÷	#œ8ô 	#ñ  “>ˆÜ(¬Ó):Ó;ˆØ×"Ñ" 6Ô*Ø×"Ñ" 6Ô*Ø×Ñ˜XÔ&Ø×"Ñ" 6Ô*Ø×Ñ˜Ò 8Ô9ð 	×Ñ˜X×1Ñ1°4Ö8rA   c                ó°   € \        \        4       4      pVP                  \        4       4       V P	                  \
        VP                  \        4       4       R# )zJ
L{Response.deliverBody} raises L{RuntimeError} if called more than
once.
N)rk   r   r)  r   rˆ   r‰   r¢  s   & rB   Ú test_multipleStartProducingFailsÚ.ResponseTests.test_multipleStartProducingFails0  s;   € ô
 )¬Ó):Ó;ˆØ×ÑœX›ZÔ(Ø×Ñœ,¨×(<Ñ(<¼h»jÖIrA   c                óÐ   € \        \        4       4      pVP                  \        4       4       VP	                  4        V P                  \        VP                  \        4       4       R# )z_
L{Response.deliverBody} raises L{RuntimeError} if called after
L{Response._bodyDataFinished}.
N)rk   r   r)  r   r  rˆ   r‰   r¢  s   & rB   Ú%test_startProducingAfterFinishedFailsÚ3ResponseTests.test_startProducingAfterFinishedFails9  sG   € ô
 )¬Ó):Ó;ˆØ×ÑœX›ZÔ(Ø×"Ñ"Ô$Ø×Ñœ,¨×(<Ñ(<¼h»jÖIrA   c                óŽ   € \        \        4       4      pVP                  4        V P                  \        VP
                  R4       R# )zˆ
L{Response._bodyDataReceived} raises L{RuntimeError} if called after
L{Response._bodyDataFinished} but before L{Response.deliverBody}.
rñ   N)rk   r   r  rˆ   r‰   r  r¢  s   & rB   Ú'test_bodyDataReceivedAfterFinishedFailsÚ5ResponseTests.test_bodyDataReceivedAfterFinishedFailsC  s5   € ô
 )¬Ó):Ó;ˆØ×"Ñ"Ô$Ø×Ñœ,¨×(BÑ(BÀFÖKrA   c                óÀ   € \        \        4       4      pVP                  4        VP                  \	        4       4       V P                  \        VP                  R4       R# )z‡
L{Response._bodyDataReceived} raises L{RuntimeError} if called after
L{Response._bodyDataFinished} and after L{Response.deliverBody}.
rñ   N)rk   r   r  r)  r   rˆ   r‰   r  r¢  s   & rB   Ú'test_bodyDataReceivedAfterDeliveryFailsÚ5ResponseTests.test_bodyDataReceivedAfterDeliveryFailsL  sE   € ô
 )¬Ó):Ó;ˆØ×"Ñ"Ô$Ø×ÑœX›ZÔ(Ø×Ñœ,¨×(BÑ(BÀFÖKrA   c                óŒ   € \        \        4       4      pVP                  4        V P                  \        VP                  4       R# )zP
L{Response._bodyDataFinished} raises L{RuntimeError} if called more
than once.
N)rk   r   r  rˆ   r‰   r¢  s   & rB   Ú'test_bodyDataFinishedAfterFinishedFailsÚ5ResponseTests.test_bodyDataFinishedAfterFinishedFailsV  s3   € ô
 )¬Ó):Ó;ˆØ×"Ñ"Ô$Ø×Ñœ,¨×(BÑ(BÖCrA   c                ó¾   € \        \        4       4      pVP                  4        VP                  \	        4       4       V P                  \        VP                  4       R# )zc
L{Response._bodyDataFinished} raises L{RuntimeError} if called after
the body has been delivered.
N)rk   r   r  r)  r   rˆ   r‰   r¢  s   & rB   Ú'test_bodyDataFinishedAfterDeliveryFailsÚ5ResponseTests.test_bodyDataFinishedAfterDeliveryFails_  sC   € ô
 )¬Ó):Ó;ˆØ×"Ñ"Ô$Ø×ÑœX›ZÔ(Ø×Ñœ,¨×(BÑ(BÖCrA   c                ó@  a€ . o ! V3R lR\         4      p\        4       pVP                  4        V! 4       p\        V4      pV P	                  VP
                  R4       VP                  V4       V P	                  SR.4       V P	                  VP
                  R4       R# )z~
L{Response.deliverBody} resumes the HTTP connection's transport
after passing it to the consumer's C{makeConnection} method.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú9ResponseTests.test_transportResumed.<locals>.ListConsumerip  c                ó>   <€ SP                  VP                  4       R # rs   )r‘   r  )rS   rj   ÚtransportStates   &&€rB   r“   ÚHResponseTests.test_transportResumed.<locals>.ListConsumer.makeConnectionq  s   ø€ Ø×%Ñ% i×&=Ñ&=Ö>rA   r9   Nr«  )r„   rä  s   @€rB   r¹  râ  p  s   ù‡ € ÷?ó ?rA   r¹  rC  r  N)r   r   rÓ  rk   rM   r  r)  )rS   r¹  rj   r˜   rù   rä  s   &    @rB   Útest_transportResumedÚ#ResponseTests.test_transportResumedi  s‰   ø€ ð
 ˆ÷	?œ8ô 	?ô $Ó%ˆ	Ø× Ñ Ô"Ù“>ˆÜ(¨Ó3ˆØ×Ñ˜×0Ñ0°(Ô;Ø×Ñ˜XÔ&Ø×Ñ˜¨(¨Ô4Ø×Ñ˜×0Ñ0°+Ö>rA   c                ó@  € \        4       p\        V4      pVP                  R4       VP                  R4       VP                  4        \	        4       pVP                  V4       V P                  VP                  R4       VP                  P                  \        4       R# )zË
If the entire body is delivered to the L{Response} before the
response's C{deliverBody} method is called, the protocol passed to
C{deliverBody} is immediately given the body data and then
disconnected.
rñ   r¤   r/  N)r   rk   r  r  r   r)  rM   rê   rE  rL   r.   ©rS   rj   rù   r˜   s   &   rB   Ú)test_bodyDataFinishedBeforeStartProducingÚ7ResponseTests.test_bodyDataFinishedBeforeStartProducing}  s|   € ô $Ó%ˆ	Ü(¨Ó3ˆØ×"Ñ" 6Ô*Ø×"Ñ" 6Ô*Ø×"Ñ"Ô$ä'Ó)ˆØ×Ñ˜XÔ&Ø×Ñ˜Ÿ™¨	Ô2Ø×Ñ×"Ñ"¤<Ö0rA   c                ó   € \        4       p\        V4      p\        4       pVP                  V4       V P	                  VP
                  R4       VP                  \        \        4       4      4       VP                  P                  \        4       R# )zá
The L{Failure} passed to L{Response._bodyDataFinished} when the response
is in the I{connected} state is passed to the C{connectionLost} method
of the L{IProtocol} provider passed to the L{Response}'s
C{deliverBody} method.
Ú	CONNECTEDN)r   rk   r   r)  rM   r�   r  r   r8   rE  rL   ré  s   &   rB   Ú#test_finishedWithErrorWhenConnectedÚ1ResponseTests.test_finishedWithErrorWhenConnected�  sn   € ô $Ó%ˆ	Ü(¨Ó3ˆä'Ó)ˆØ×Ñ˜XÔ&ð 	×Ñ˜Ÿ™¨+Ô6Ø×"Ñ"¤7Ô+=Ó+?Ó#@ÔAà×Ñ×"Ñ"Ô#5Ö6rA   c                ó   € \        4       p\        V4      pV P                  VP                  R4       VP	                  \        \        4       4      4       \        4       pVP                  V4       VP                  P                  \        4       R# )zß
The L{Failure} passed to L{Response._bodyDataFinished} when the response
is in the I{initial} state is passed to the C{connectionLost} method of
the L{IProtocol} provider passed to the L{Response}'s C{deliverBody}
method.
ÚINITIALN)r   rk   rM   r�   r  r   r8   r   r)  rE  rL   ré  s   &   rB   Ú!test_finishedWithErrorWhenInitialÚ/ResponseTests.test_finishedWithErrorWhenInitial¢  sn   € ô $Ó%ˆ	Ü(¨Ó3ˆð 	×Ñ˜Ÿ™¨)Ô4Ø×"Ñ"¤7Ô+=Ó+?Ó#@ÔAä'Ó)ˆØ×Ñ˜XÔ&à×Ñ×"Ñ"Ô#5Ö6rA   r9   N)r;   r<   r=   r>   r?   r£  r®  r»  rÄ  rÌ  rÏ  rÒ  rÕ  rØ  rÛ  rÞ  ræ  rê  rî  rò  r@   r‚   rƒ   s   @rB   r   r   Ë
  s`   ø‡ € ñò;ò?ò,*ò&;ò29ò.JòJòLòLòDòDò?ò(1ò$7÷&7ð 7rA   r   N)_r?   Útypingr   Úzope.interfacer   Úzope.interface.verifyr   Útwisted.internet.deferr   r   r   r   Útwisted.internet.errorr	   r
   Útwisted.internet.interfacesr   r   Útwisted.internet.protocolr   Útwisted.internet.testingr   r   r   r   Útwisted.loggerr   Útwisted.protocols.basicr   Útwisted.python.failurer   Útwisted.trial.unittestr   Útwisted.web._newclientr   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   Útwisted.web.clientr(   r)   r*   r+   r,   r-   r.   r/   r0   Útwisted.web.httpr1   Útwisted.web.http_headersr2   Útwisted.web.iwebr3   r4   Útwisted.web.test.requesthelperr5   r6   Ú	Exceptionr8   rD   rh   r[   r^   r`   rb   rk   rm   rŽ   rÛ   rß   râ   r¹  rÈ  rÎ  r¿  rÚ  rS  rw  r„  r   r9   rA   rB   Ú<module>r     s‘  ðñõ å &Ý .ç JÓ Jß Aß @Ý .÷ó õ .Ý 0Ý *Ý +÷÷ ÷ ÷ ÷ ÷(
÷ 
õ 
õ 'Ý ,ß 5÷ô˜ô ô 	ô ñ ˜' NÐ#3Ð4Ó5€ò%òPTòòòLô6 (ô 6÷BSMñ SMôlÐ+;¸Xô ôÐ.>Àô ôh
.˜Hô h
.÷Vñ ÷0ñ ôfE ô fEñR ˆ]Ó÷ ð  ó ð ôFp;�8ô p;ôfb 8ô bôJ):˜xô ):ôX{- (ô {-ô|h7�Hö h7rA   