+
    üÐjç¾  ã                   ó¾  € R t ^ RIHtHtHtHtHt ^ RIHt ^ RI	H
t
 ^ RIHt ]P                  t^ RIHt  ! R R]P                   4      t ! R R	]4      t ! R
 R]P(                  4      t ! R R]P(                  4      t ! R R]P(                  4      t ! R R]P(                  4      t ! R R4      t ! R R]P4                  4      t ! R R]P4                  4      tR# )z%
Tests for L{twisted.internet.task}.
)ÚdeferÚerrorÚ
interfacesÚreactorÚtask)ÚinstallReactor)Ú	NoReactor)Úunittest)Úfailurec                   ó2   a a€ ] tR t^t oV 3R ltRtVtV ;t# )ÚTestableLoopingCallc                ó4   <€ \         SV `  ! V/ VB  Wn        R # ©N)ÚsuperÚ__init__Úclock)Úselfr   ÚaÚkwÚ	__class__s   &&*,€Ú8/usr/lib/python3/dist-packages/twisted/test/test_task.pyr   ÚTestableLoopingCall.__init__   s   ø€ Ü‰Ò˜!Ð"˜rÒ"ØŽ
ó    )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r   r      s   ù‡ € ÷õ r   r   c                   ó   € ] tR t^tRtR# )ÚTestException© N©r   r   r   r   r   r#   r   r   r"   r"      s   † Ûr   r"   c                   ó~   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R tR tR tR tRtV tR# )Ú
ClockTestsz4
Test the non-wallclock based clock implementation.
c                óp   € \         P                  ! 4       pV P                  VP                  4       ^ 4       R# )zF
Test that the C{seconds} method of the fake clock returns fake time.
N)r   ÚClockÚassertEqualÚseconds©r   Úcs   & r   ÚtestSecondsÚClockTests.testSeconds#   s%   € ô �JŠJ‹LˆØ×Ñ˜Ÿ™› aÖ(r   c                ó6  € \         P                  ! 4       pVP                  ^R ^^R7      pV P                  \        P
                  P                  V4      4       V P                  VP                  4       ^4       V P                  VP                  4       4       R# )zc
Test that calls can be scheduled for later with the fake clock and
hands back an L{IDelayedCall}.
c                 ó   € R # r   r#   ©r   Úbs   &&r   Ú<lambda>Ú*ClockTests.testCallLater.<locals>.<lambda>0   ó   € ©4r   ©r2   N)
r   r(   Ú	callLaterÚ
assertTruer   ÚIDelayedCallÚ
providedByr)   ÚgetTimeÚactive©r   r,   Úcalls   &  r   ÚtestCallLaterÚClockTests.testCallLater*   sk   € ô
 �JŠJ‹LˆØ�{‰{˜1Ñ/°°aˆ{Ó8ˆØ�‰œ
×/Ñ/×:Ñ:¸4Ó@ÔAØ×Ñ˜Ÿ™›¨Ô+Ø�‰˜Ÿ™›Ö&r   c                óº   € \         P                  ! 4       pVP                  ^R ^^R7      pVP                  4        V P	                  VP                  4       4       R# )z#
Test that calls can be cancelled.
c                 ó   € R # r   r#   r1   s   &&r   r3   Ú3ClockTests.testCallLaterCancelled.<locals>.<lambda>:   r5   r   r6   N)r   r(   r7   ÚcancelÚassertFalser<   r=   s   &  r   ÚtestCallLaterCancelledÚ!ClockTests.testCallLaterCancelled5   sC   € ô �JŠJ‹LˆØ�{‰{˜1Ñ/°°aˆ{Ó8ˆØ�‰ŒØ×Ñ˜Ÿ™›Ö'r   c                ó¬   € \         P                  ! 4       pVP                  ^
R ^^R7      pVP                  ^R ^^R7      pV P                  W#J 4       R# )zC
Test that the DelayedCall returned is not one previously
created.
c                 ó   € R # r   r#   r1   s   &&r   r3   Ú3ClockTests.test_callLaterOrdering.<locals>.<lambda>D   s   € ©Tr   r6   c                 ó   € R # r   r#   r1   s   &&r   r3   rJ   E   s   € ©Dr   N)r   r(   r7   rE   )r   r,   Úcall1Úcall2s   &   r   Útest_callLaterOrderingÚ!ClockTests.test_callLaterOrdering>   sM   € ô
 �JŠJ‹LˆØ—‘˜BÑ 1°1¸�Ó:ˆØ—‘˜AÑ0°!°q�Ó9ˆØ×Ñ˜˜Ö(r   c                ó.  a€ . o\         P                  ! 4       pVP                  ^V3R l4      pVP                  ^4       V P	                  S. 4       VP                  ^4       V P	                  SR.4       V P                  VP                  4       4       R# )z5
Test that advancing the clock will fire some calls.
c                  ó&   <€ S P                  R 4      # r   ©Úappend)Úeventss   €r   r3   Ú(ClockTests.testAdvance.<locals>.<lambda>N   s   ø€  f§m¡m°DÔ&9r   N)r   r(   r7   Úadvancer)   rE   r<   ©r   r,   r>   rT   s   &  @r   ÚtestAdvanceÚClockTests.testAdvanceH   sr   ø€ ð ˆÜ�JŠJ‹LˆØ�{‰{˜1Ô9Ó:ˆØ	�	‰	�!ŒØ×Ñ˜ Ô$Ø	�	‰	�!ŒØ×Ñ˜ $ Ô(Ø×Ñ˜Ÿ™›Ö'r   c                óˆ   a a€ \         P                  ! 4       pVV 3R lpVP                  ^V4      oVP                  ^4       R# )zÝ
Test attempting to cancel the call in a callback.

AlreadyCalled should be raised, not for example a ValueError from
removing the call from Clock.calls. This requires call.called to be
set before the callback is called.
c                  ó\   <€ SP                  \        P                  S P                  4       R # r   )ÚassertRaisesr   ÚAlreadyCalledrD   )r>   r   s   €€r   ÚcbÚ(ClockTests.testAdvanceCancel.<locals>.cb_   s   ø€ Ø×Ñœe×1Ñ1°4·;±;Ö?r   N)r   r(   r7   rV   )r   r,   r^   r>   s   f  @r   ÚtestAdvanceCancelÚClockTests.testAdvanceCancelU   s3   ù€ ô �JŠJ‹Lˆö	@ð �{‰{˜1˜bÓ!ˆØ	�	‰	�!Žr   c                óX  a€ . o\         P                  ! 4       pVP                  ^V3R l^^R7      pVP                  ^4       V P	                  VP                  4       ^4       VP                  R4       V P	                  S. 4       VP                  R4       V P	                  SR.4       R# )z!
Test that calls can be delayed.
c                 ó(   <€ SP                  W34      # r   rR   ©r   r2   rT   s   &&€r   r3   Ú1ClockTests.testCallLaterDelayed.<locals>.<lambda>k   ó   ø€ ¨6¯=©=¸!¸Ô+@r   r6   g      ø?ç      ð?N©é   é   )r   r(   r7   Údelayr)   r;   rV   rW   s   &  @r   ÚtestCallLaterDelayedÚClockTests.testCallLaterDelayede   s…   ø€ ð ˆÜ�JŠJ‹LˆØ�{‰{˜1Ô@À!Àqˆ{ÓIˆØ�
‰
�1ŒØ×Ñ˜Ÿ™›¨Ô+Ø	�	‰	�#ŒØ×Ñ˜ Ô$Ø	�	‰	�#ŒØ×Ñ˜ & Ö*r   c                óz  a€ . o\         P                  ! 4       pVP                  ^V3R l^^R7      pVP                  ^4       VP	                  ^4       V P                  VP                  4       ^4       VP                  ^4       V P                  S. 4       VP                  ^4       V P                  SR.4       R# )z<
Test that calls can have their time reset to a later time.
c                 ó(   <€ SP                  W34      # r   rR   rd   s   &&€r   r3   Ú4ClockTests.testCallLaterResetLater.<locals>.<lambda>y   rf   r   r6   Nrh   )r   r(   r7   rV   Úresetr)   r;   rW   s   &  @r   ÚtestCallLaterResetLaterÚ"ClockTests.testCallLaterResetLaters   s�   ø€ ð ˆÜ�JŠJ‹LˆØ�{‰{˜1Ô@À!Àqˆ{ÓIˆØ	�	‰	�!ŒØ�
‰
�1ŒØ×Ñ˜Ÿ™›¨Ô+Ø	�	‰	�!ŒØ×Ñ˜ Ô$Ø	�	‰	�!ŒØ×Ñ˜ & Ö*r   c                ó  a€ . o\         P                  ! 4       pVP                  ^V3R l^^R7      pVP                  ^4       V P	                  VP                  4       ^4       VP                  ^4       V P	                  SR.4       R# )z?
Test that calls can have their time reset to an earlier time.
c                 ó(   <€ SP                  W34      # r   rR   rd   s   &&€r   r3   Ú5ClockTests.testCallLaterResetSooner.<locals>.<lambda>ˆ   rf   r   r6   Nrh   )r   r(   r7   rq   r)   r;   rV   rW   s   &  @r   ÚtestCallLaterResetSoonerÚ#ClockTests.testCallLaterResetSooner‚   sj   ø€ ð ˆÜ�JŠJ‹LˆØ�{‰{˜1Ô@À!Àqˆ{ÓIˆØ�
‰
�1ŒØ×Ñ˜Ÿ™›¨Ô+Ø	�	‰	�!ŒØ×Ñ˜ & Ö*r   c                óÔ   € \         P                  ! 4       pVP                  ^R 4      pVP                  ^R 4      pVP                  4       pV P	                  W#0\        V4      4       R# )z2
Test that we can get a list of all delayed calls
c                 ó   € R # r   r#   ©Úxs   &r   r3   Ú1ClockTests.test_getDelayedCalls.<locals>.<lambda>“   ó   € ©r   c                 ó   € R # r   r#   r{   s   &r   r3   r}   ”   s   € ©r   N)r   r(   r7   ÚgetDelayedCallsr)   Úset)r   r,   r>   rM   Úcallss   &    r   Útest_getDelayedCallsÚClockTests.test_getDelayedCallsŽ   sS   € ô �JŠJ‹LˆØ�{‰{˜1™nÓ-ˆØ—‘˜A™~Ó.ˆà×!Ñ!Ó#ˆà×Ñ˜$˜¬¨E«
Ö3r   c                óp   € \         P                  ! 4       pV P                  VP                  4       . 4       R# )zS
Test that we get an empty list from getDelayedCalls on a newly
constructed Clock.
N)r   r(   r)   r€   r+   s   & r   Útest_getDelayedCallsEmptyÚ$ClockTests.test_getDelayedCallsEmptyš   s(   € ô
 �JŠJ‹LˆØ×Ñ˜×*Ñ*Ó,¨bÖ1r   c                óŽ   € \         P                  ! 4       pV P                  \        P                  P                  V4      R 4       R# )z#Clock does not provide IReactorTimeN)r   r(   r8   r   ÚIReactorTimer:   r+   s   & r   Útest_providesIReactorTimeÚ$ClockTests.test_providesIReactorTime¢   s0   € Ü�JŠJ‹LˆØ�‰Ü×#Ñ#×.Ñ.¨qÓ1Ð3Xö	
r   c                ó  aa€ . oRR	.p\         P                  ! 4       oVV3R lpSP                  RVR4      pVP                  R4       SP                  RVR4       SP	                  ^.^,          4       V P                  SV4       R# )
aì  
The order of calls scheduled by L{task.Clock.callLater} is honored when
adding a new call via calling L{task.Clock.callLater} again.

For example, if L{task.Clock.callLater} is invoked with a callable "A"
and a time t0, and then the L{IDelayedCall} which results from that is
C{reset} to a later time t2 which is greater than t0, and I{then}
L{task.Clock.callLater} is invoked again with a callable "B", and time
t1 which is less than t2 but greater than t0, "B" will be invoked before
"A".
r2   ç       @r   ç      @c                 óF   <€ SP                  V SP                  4       34      # r   ©rS   r*   ©Únr   Úresults   &€€r   r3   Ú<ClockTests.test_callLaterKeepsCallsOrdered.<locals>.<lambda>·   ó   ø€ ˜FŸM™M¨1¨e¯m©m«oÐ*>Ô?r   rg   N©r2   r�   ©r   rŽ   ©r   r(   r7   rq   Úpumpr)   ©r   ÚexpectedÚlogtimeÚcall_ar   r“   s   &   @@r   Útest_callLaterKeepsCallsOrderedÚ*ClockTests.test_callLaterKeepsCallsOrdered¨   st   ù€ ð ˆØ 
Ð+ˆÜ—
’
“ˆÝ?ˆà—‘  g¨sÓ3ˆØ�‰�SÔØ�‰˜˜W cÔ*à�
‰
�A�3˜•7ÔØ×Ñ˜ Ö*r   c                ó  aa€ . oRR	.p\         P                  ! 4       oVV3R lpSP                  RVR4      pSP                  RVR4       VP                  R4       SP	                  ^.^,          4       V P                  SV4       R# )
aò  
The order of calls scheduled by L{task.Clock.callLater} is honored when
re-scheduling an existing call via L{IDelayedCall.reset} on the result
of a previous call to C{callLater}.

For example, if L{task.Clock.callLater} is invoked with a callable "A"
and a time t0, and then L{task.Clock.callLater} is invoked again with a
callable "B", and time t1 greater than t0, and finally the
L{IDelayedCall} for "A" is C{reset} to a later time, t2, which is
greater than t1, "B" will be invoked before "A".
r2   r�   r   rŽ   c                 óF   <€ SP                  V SP                  4       34      # r   r�   r‘   s   &€€r   r3   ÚAClockTests.test_callLaterResetKeepsCallsOrdered.<locals>.<lambda>Ï   r•   r   rg   Nr–   r—   r˜   rš   s   &   @@r   Ú$test_callLaterResetKeepsCallsOrderedÚ/ClockTests.test_callLaterResetKeepsCallsOrderedÀ   st   ù€ ð ˆØ 
Ð+ˆÜ—
’
“ˆÝ?ˆà—‘  g¨sÓ3ˆØ�‰˜˜W cÔ*Ø�‰�SÔà�
‰
�A�3˜•7ÔØ×Ñ˜ Ö*r   c                ó"  aaa€ . oR
R.p\         P                  ! 4       oVV3R lpSP                  RVR4      oV3R lpSP                  RV4       SP                  RVR4       SP                  R.^
,          4       V P	                  SV4       R	# )a  
The order of calls scheduled by L{task.Clock.callLater} is honored when
re-scheduling an existing call via L{IDelayedCall.reset} on the result
of a previous call to C{callLater}, even when that call to C{reset}
occurs within the callable scheduled by C{callLater} itself.
r,   rŽ   r2   c                 óF   <€ SP                  V SP                  4       34      # r   r�   r‘   s   &€€r   r3   ÚKClockTests.test_callLaterResetInsideCallKeepsCallsOrdered.<locals>.<lambda>â   r•   r   r�   c                  ó*   <€ S P                  R 4       R# )rŽ   N)rq   )Úcall_bs   €r   r   ÚDClockTests.test_callLaterResetInsideCallKeepsCallsOrdered.<locals>.aæ   s   ø€ Ø�L‰L˜Ör   rg   ç      à?N)r,   rŽ   )r2   g      @)r   r(   r7   r™   r)   )r   r›   rœ   r   r©   r   r“   s   &   @@@r   Ú.test_callLaterResetInsideCallKeepsCallsOrderedÚ9ClockTests.test_callLaterResetInsideCallKeepsCallsOrderedØ   s}   ú€ ð ˆØ 
Ð+ˆÜ—
’
“ˆÝ?ˆà—‘  g¨sÓ3ˆõ	ð 	�‰˜˜QÔØ�‰˜˜W cÔ*à�
‰
�C�5˜2•:ÔØ×Ñ˜ Ö*r   r#   N)r   r   r   r   Ú__doc__r-   r?   rF   rN   rX   r`   rl   rr   rw   rƒ   r†   rŠ   rž   r£   r¬   r   r   ©r    s   @r   r&   r&      sZ   ø‡ € ñò)ò	'ò(ò)ò(òò +ò+ò
+ò
4ò2ò
ò+ò0+÷0+ð +r   r&   c                   ó–   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R tR tR tR tR tR tR tR tRtV tR# )Ú	LoopTestszO
Tests for L{task.LoopingCall} based on a fake L{IReactorTime}
implementation.
c                ót   € \         P                  ! R 4      pV P                  VP                  \        4       R# )z7
L{LoopingCall}'s default clock should be the reactor.
c                  ó   € R # r   r#   r#   r   r   r3   Ú-LoopTests.test_defaultClock.<locals>.<lambda>ú   r~   r   N)r   ÚLoopingCallr)   r   r   )r   r>   s   & r   Útest_defaultClockÚLoopTests.test_defaultClockö   s(   € ô ×Ò¡Ó-ˆØ×Ñ˜Ÿ™¤WÖ-r   c                óÂ  aaa€ . oRo\         P                  ! 4       oVVV3R lp\         P                  ! V4      pSVn        ^oVP	                  R4       V P                  S^ .4       V P                  SP                  4       S4       SP                  ^ 4       V P                  S^ .4       ^oSP                  R4       V P                  S^ R.4       V P                  SP                  4       R4       SP                  ^ 4       V P                  S^ R.4       ^ oSP                  R4       V P                  S. RO4       V P                  SP                  4       ^4       R# )z¶
When more time than the defined interval passes during the execution
of a callback, L{LoopingCall} should schedule the next call for the
next interval which is still in the future.
Nc                  óh   <€ SP                  SP                  4       4       SP                  S 4       R # r   )rS   r*   rV   )ÚcallDurationr   Útimess   €€€r   Ú	aCallbackÚ3LoopTests.test_callbackTimeSkips.<locals>.aCallback  s!   ø€ Ø�L‰L˜Ÿ™›Ô)Ø�M‰M˜,Ö'r   r«   ç      @g      @)é    r¾   é   )r   r(   rµ   r   Ústartr)   r*   rV   )r   r¼   r>   rº   r   r»   s   &  @@@r   Útest_callbackTimeSkipsÚ LoopTests.test_callbackTimeSkipsý   s.  ú€ ð ˆØˆÜ—
’
“ˆ÷	(ô ×Ò 	Ó*ˆØˆŒ
ð ˆØ�
‰
�3Œð 	×Ñ˜  Ô$ð 	×Ñ˜Ÿ™›¨,Ô7ð
 	�‰�aÔØ×Ñ˜  Ô$ð ˆØ�‰�cÔØ×Ñ˜  C Ô)Ø×Ñ˜Ÿ™›¨#Ô.ð 	�‰�aÔØ×Ñ˜  C Ô)ð ˆØ�‰�cÔØ×Ñ˜¢Ô,Ø×Ñ˜Ÿ™›¨!Ö,r   c                ó¦  aa€ . o\         P                  ! 4       oVV3R lp\         P                  ! V4      pSVn        VP	                  R4       V P                  S^ .4       SP                  ^4       V P                  S^ ^.4       SP                  ^4       V P                  S. RO4       SP                  ^ 4       V P                  S. RO4       R# )zá
When more time than the defined interval passes between when
L{LoopingCall} schedules itself to run again and when it actually
runs again, it should schedule the next call for the next interval
which is still in the future.
c                  óF   <€ SP                  S P                  4       4       R # r   r�   )r   r»   s   €€r   r¼   Ú2LoopTests.test_reactorTimeSkips.<locals>.aCallback;  s   ø€ Ø�L‰L˜Ÿ™›Ö)r   r«   N)r¿   rj   é   )r   r(   rµ   r   rÁ   r)   rV   )r   r¼   r>   r   r»   s   &  @@r   Útest_reactorTimeSkipsÚLoopTests.test_reactorTimeSkips1  s°   ù€ ð ˆÜ—
’
“ˆö	*ô
 ×Ò 	Ó*ˆØˆŒ
Ø�
‰
�3Œð 	×Ñ˜  Ô$ð 	�‰�aÔØ×Ñ˜  A Ô'ð 	�‰�aÔØ×Ñ˜¢	Ô*ð 	�‰�aÔØ×Ñ˜¢	Ö*r   c                óx  aa€ . o\         P                  ! 4       oVV3R lp\         P                  P                  V4      pSVn        RpRpVP                  V4       V P                  SR.4       SP                  W4,           4       V P                  SRW4,           ^3.4       SP                  ^V,          V,           4       V P                  SRW4,           ^3^V,          ^V,          ,           ^3.4       SP                  ^ 4       V P                  SRW4,           ^3^V,          ^V,          ,           ^3.4       R# )at  
When L{LoopingCall} schedules itself to run again, if more than the
specified interval has passed, it should schedule the next call for the
next interval which is still in the future. If it was created
using L{LoopingCall.withCount}, a positional argument will be
inserted at the beginning of the argument list, indicating the number
of calls that should have been made.
c                 óJ   <€ SP                  SP                  4       V 34       R # r   r�   )ÚnumCallsr   r»   s   &€€r   r¼   Ú7LoopTests.test_reactorTimeCountSkips.<locals>.aCallback_  s   ø€ Ø�L‰L˜%Ÿ-™-›/¨8Ð4Ö5r   r«   ç{®Gáz„?N©r¿   ri   )r   r(   rµ   Ú	withCountr   rÁ   r)   rV   ©r   r¼   r>   ÚINTERVALÚREALISTIC_DELAYr   r»   s   &    @@r   Útest_reactorTimeCountSkipsÚ$LoopTests.test_reactorTimeCountSkipsS  s*  ù€ ð ˆÜ—
’
“ˆö	6ô
 ×Ñ×)Ñ)¨)Ó4ˆØˆŒ
ØˆØˆØ�
‰
�8Ôð 	×Ñ˜  Ô)ð
 	�‰�hÕ0Ô1Ø×Ñ˜ ¨(Õ*DÀaÐ)HÐ IÔJð 	�‰�q˜8•| Õ6Ô7Ø×ÑØàØÕ+¨QÐ/Ø�h•, 1 Õ#6Õ7¸Ð;ðô	
ð 	�‰�aÔØ×ÑØàØÕ+¨QÐ/Ø�h•, 1 Õ#6Õ7¸Ð;ðö	
r   c                óš  aa€ . o\         P                  ! 4       oVV3R lp\         P                  P                  V4      pSVn        RpRpVP                  V4       V P                  SP                  4       R	4       SP                  W4,           4       V P                  SP                  4       W4,           ^34       SP                  VR,          4       V P                  SP                  4       RV,          V,           ^34       SP                  VR,          4       V P                  SP                  4       RV,          V,           ^34       R# )
aÑ  
L{LoopingCall.withCount} counts only calls that were expected to be
made.  So, if more than one, but less than two intervals pass between
invocations, it won't increase the count above 1.  For example, a
L{LoopingCall} with interval T expects to be invoked at T, 2T, 3T, etc.
However, the reactor takes some time to get around to calling it, so in
practice it will be called at T+something, 2T+something, 3T+something;
and due to other things going on in the reactor, "something" is
variable.  It won't increase the count unless "something" is greater
than T.  So if the L{LoopingCall} is invoked at T, 2.75T, and 3T,
the count has not increased, even though the distance between
invocation 1 and invocation 2 is 1.75T.
c                 óJ   <€ SP                  SP                  4       V 34       R # r   r�   )Úcountr   r»   s   &€€r   r¼   Ú<LoopTests.test_countLengthyIntervalCounts.<locals>.aCallbackž  s   ø€ Ø�L‰L˜%Ÿ-™-›/¨5Ð1Ö2r   r«   rÎ   g      ü?g      @g      Ð?rŽ   NrÏ   )	r   r(   rµ   rÐ   r   rÁ   r)   ÚpoprV   rÑ   s   &    @@r   Útest_countLengthyIntervalCountsÚ)LoopTests.test_countLengthyIntervalCounts�  s   ù€ ð ˆÜ—
’
“ˆö	3ô
 ×Ñ×)Ñ)¨)Ó4ˆØˆŒ
ØˆØˆØ�
‰
�8ÔØ×Ñ˜Ÿ™› fÔ-ð 	�‰�hÕ0Ô1Ø×Ñ˜Ÿ™› xÕ'AÀ1Ð&EÔFð 	�‰�h •oÔ&Ø×Ñ˜Ÿ™›¨¨x­¸?Õ'JÈAÐ&NÔOð 	�‰�h •oÔ&Ø×Ñ˜Ÿ™›¨¨h­¸/Õ'IÈ1Ð&MÖNr   c                óR  € \         P                  ! 4       p. p\         P                  P                  VP                  4      pWn        ^
pRpWT,          pVP                  VRR7       \        V4       F  pVP                  V4       K  	  R pWX! V.V,          4      ,
          p	VP                  V	4       VP                  4       p
V P                  \        V	4      R8„  V	 R24       V P                  W¥8¬  V
 RV 24       V P                  V! V4      V4       V P                  ^ V4       R# )	a=  
L{task.LoopingCall.withCount} should never invoke its callable with a
zero.  Specifically, if a L{task.LoopingCall} created with C{withCount}
has its L{start <task.LoopingCall.start>} method invoked with a
floating-point number which introduces decimal inaccuracy when
multiplied or divided, such as "0.1", L{task.LoopingCall} will never
invoke its callable with 0.  Also, the sum of all the values passed to
its callable as the "count" will be an integer, the number of intervals
that have elapsed.

This is a regression test for a particularly tricky case to implement.
rg   F©Únowc                ó,   € RpV  F  pW,          pK  	  V# )z°
Make sure the result is more precise.
On Python 3.11 or older this can be a float with ~ 0.00001
in precision difference.
See: https://github.com/python/cpython/issues/100425
ç        r#   )ÚitemsÚtotalÚitems   &  r   Ú
sum_compatÚALoopTests.test_withCountFloatingPointBoundary.<locals>.sum_compatÖ  s   € ð ˆEÛ�Ø•’ñ àˆLr   rá   z should be greater than zeroz$ should be greater than or equal to N)r   r(   rµ   rÐ   rS   r   rÁ   ÚrangerV   r*   r8   Úabsr)   ÚassertNotIn)r   r   Úaccumulatorr>   rØ   ÚtimespanÚintervalr|   rå   ÚepsilonÚsecondsValues   &          r   Ú#test_withCountFloatingPointBoundaryÚ-LoopTests.test_withCountFloatingPointBoundary¶  s  € ô —
’
“ˆØˆÜ×Ñ×)Ñ)¨+×*<Ñ*<Ó=ˆØŒ
ð
 ˆð ˆàÕ#ˆà�
‰
�8 ˆ
Ô'Ü�u–ˆAØ�M‰M˜(Ö#ñ ò
	ð ˜Z¨¨
°UÕ(:Ó;Õ;ˆØ�‰�gÔØ—}‘}“ˆð 	�‰œ˜G› sÑ*¨w¨iÐ7SÐ,TÔUð 	�‰ØÑ$ØˆnÐ@ÀÀ
ÐKô	
ð
 	×Ñ™ KÓ0°%Ô8Ø×Ñ˜˜KÖ(r   c                ó@  aa€ \         P                  ! 4       p. oVV3R lp\         P                  P                  V4      oVSn        SP                  ^ RR7      pVP                  ^ .^,          4       V P                  V4       V P                  ^.^,          S4       R# )za
L{task.LoopingCall.withCount} with interval set to 0 calls the
countCallable with a count of 1.
c                 ón   <€ SP                  V 4       \        S4      ^8”  d   SP                  4        R# R# )rÀ   N©rS   ÚlenÚstop)Úcntrê   Úloops   &€€r   ÚfooÚ1LoopTests.test_withCountIntervalZero.<locals>.foo   s,   ø€ Ø×Ñ˜sÔ#Ü�;Ó !Ô#Ø—	‘	–ñ $r   FrÞ   N)	r   r(   rµ   rÐ   r   rÁ   r™   ÚsuccessResultOfr)   )r   r   rø   Údeferredrê   r÷   s   &   @@r   Útest_withCountIntervalZeroÚ$LoopTests.test_withCountIntervalZeroø  sƒ   ù€ ô
 —
’
“ˆØˆö	ô
 ×Ñ×)Ñ)¨#Ó.ˆØˆŒ
Ø—:‘:˜a U�:Ó+ˆð 	�
‰
�A�3˜•7ÔØ×Ñ˜XÔ&à×Ñ˜!˜˜q� +Ö.r   c                ó:  aaa€ \         P                  ! 4       p\        P                  ! 4       o. oVVV3R lp\         P                  P                  V4      oVSn        SP                  ^ RR7       VP                  ^ .^,          4       V P                  ^.^,          S4       VP                  ^.^,          4       V P                  ^.^,          S4       SP                  R4       VP                  ^ .^,          4       V P                  ^.^,          S4       R# )zš
L{task.LoopingCall.withCount} with interval set to 0 and a delayed
call during the loop run will still call the countCallable 1 as if
no delay occurred.
c                 ó’   <€ SP                  V 4       \        S4      ^8X  d   S# \        S4      ^8”  d   SP                  4        R# R# )rj   Nró   )rö   rê   rû   r÷   s   &€€€r   rø   Ú6LoopTests.test_withCountIntervalZeroDelay.<locals>.foo  s>   ø€ Ø×Ñ˜sÔ#ä�;Ó 1Ô$Ø�ä�;Ó !Ô#Ø—	‘	–ñ $r   FrÞ   N)r   r(   r   ÚDeferredrµ   rÐ   r   rÁ   r™   r)   Úcallback)r   r   rø   rê   rû   r÷   s   &  @@@r   Útest_withCountIntervalZeroDelayÚ)LoopTests.test_withCountIntervalZeroDelay  sß   ú€ ô —
’
“ˆÜ—>’>Ó#ˆØˆ÷	ô ×Ñ×)Ñ)¨#Ó.ˆØˆŒ
Ø�
‰
�1˜%ˆ
Ô à�
‰
�A�3˜•7Ôà×Ñ˜!˜˜q� +Ô.ð 	�
‰
�A�3˜•7ÔØ×Ñ˜!˜˜q� +Ô.ð 	×Ñ˜$ÔØ�
‰
�A�3˜•7ÔØ×Ñ˜!˜˜q� +Ö.r   c                óÎ  a	a
a€ \         P                  ! 4       p\        P                  ! 4       o
. o	^o^p^p^	pW$,           pWS,          pV^,          pV	V
V3R lp\         P                  P                  V4      pWn        VP                  ^ RR7       VP                  ^.SV,           ,          4       V P                  ^.S,          S	4       W8n
        S
P                  R4       VP                  V4       V P                  ^^V.S	4       VP                  ^V,          4       V P                  ^^V^.S	4       VP                  ^V,          4       V P                  ^^V^^.S	4       R# )z
L{task.LoopingCall.withCount} with interval set to 0 will still keep
the time when last called so when the interval is reset.
c                 óN   <€ SP                  V 4       \        S4      S8X  d   S# R # r   ©rS   rô   )rö   rê   rû   ÚstepsBeforeDelays   &€€€r   rø   ÚILoopTests.test_withCountIntervalZeroDelayThenNonZeroInterval.<locals>.foob  s)   ø€ Ø×Ñ˜sÔ#Ü�;ÓÐ#3Ô3Ø�ñ 4r   FrÞ   N)r   r(   r   r  rµ   rÐ   r   rÁ   r™   r)   rì   r  rV   )r   r   ÚextraTimeAfterDelayÚmutatedLoopIntervalÚdurationOfDelayÚskippedTimeÚexpectedSkipCountrø   r÷   rê   rû   r  s   &        @@@r   Ú2test_withCountIntervalZeroDelayThenNonZeroIntervalÚ<LoopTests.test_withCountIntervalZeroDelayThenNonZeroInterval8  s[  ú€ ô
 —
’
“ˆÜ—>’>Ó#ˆØˆð Ðð
  Ðð  Ðð ˆð
 *Õ;ˆð (Õ>Ðð 	˜QÕÐ÷	 ô
 ×Ñ×)Ñ)¨#Ó.ˆØŒ
Ø�
‰
�1˜%ˆ
Ô ð 	�
‰
�A�3Ð*Ð-@Õ@ÕAÔBØ×Ñ˜!˜Ð/Õ/°Ô=ð ,ŒØ×Ñ˜$Ôà�‰�oÔ&à×Ñ˜!˜QÐ 1Ð2°KÔ@à�‰�aÐ-Õ-Ô.Ø×Ñ˜!˜QÐ 1°1Ð5°{ÔCà�‰�aÐ-Õ-Ô.Ø×Ñ˜!˜QÐ 1°1°aÐ8¸+ÖFr   c                ól  aa€ . R
Op\         P                  ! 4       p. oRV3R llp\        W#RRRR7      pVP                  R4      p. oV3R lpVP	                  V4       VP                  V4       V P                  \        S4      ^R	\        S4      3,          4       S FM  w  rxršV P                  VR4       V P                  VR4       V P                  V	4       V P                  V
R4       KO  	  VP                  4        V P                  S^ ,          V4       V P                  VP                  4       R# )çš™™™™™©?çš™™™™™¹?Nc                 ó.   <€ SP                  WW#34       R # r   rR   )r   r2   r,   ÚdÚLs   &&&&€r   rø   Ú(LoopTests.testBasicFunction.<locals>.fooŒ  s   ø€ Ø�H‰H�a˜A�\Ö"r   r   r2   r  ©r  c                 ó*   <€ SP                  V 4       R # r   rR   ©r“   Ú	theResults   &€r   Ú
saveResultÚ/LoopTests.testBasicFunction.<locals>.saveResult”  ó   ø€ Ø×Ñ˜VÖ$r   zgot %d iterations, not 3©r  r  r  )NN)r   r(   r   rÁ   ÚaddCallbackr™   r)   rô   ÚassertIsNonerõ   ÚassertIsrE   r‚   )r   Útimingsr   rø   ÚlcÚDr  r   r2   r,   r  r  r  s   &          @@r   ÚtestBasicFunctionÚLoopTests.testBasicFunction�  s  ù€ ò
 #ˆä—
’
“ˆàˆ÷	#ô ! ¨S°#¸Ô=ˆØ�H‰H�S‹Mˆàˆ	õ	%ð 	
�‰�jÔ!à�
‰
�7Ôà×Ñœ˜Q› Ð$>Ä#ÀaÃ&ÀÕ$JÔKã‰JˆA�!Ø×Ñ˜Q Ô$Ø×Ñ˜Q Ô$Ø×Ñ˜aÔ Ø×Ñ˜Q Ö$ñ	 ð 	�‰Œ	Ø�‰�i •l BÔ'ð 	×Ñ˜Ÿ™Ö%r   c                óÆ  a€ . ROp\         P                  ! 4       p. p\        W#P                  R4      pVP	                  RRR7      p. oV3R lpVP                  V4       VP                  V4       V P                  \        V4      ^R\        V4      3,          4       VP                  4        V P                  S^ ,          V4       V P                  VP                  4       R# )r  r  NFrÞ   c                 ó*   <€ SP                  V 4       R # r   rR   r  s   &€r   r  Ú.LoopTests.testDelayedStart.<locals>.saveResult´  r  r   zgot %d iterations, not 2r  )r   r(   r   rS   rÁ   r   r™   r)   rô   rõ   r"  rE   r‚   )r   r#  r   r  r$  r  r  r  s   &      @r   ÚtestDelayedStartÚLoopTests.testDelayedStart©  s­   ø€ Ú"ˆä—
’
“ˆàˆÜ  ¯©°$Ó7ˆØ�H‰H�S˜eˆHÓ$ˆàˆ	õ	%ð 	
�‰�jÔ!à�
‰
�7Ôà×Ñœ˜Q› Ð$>Ä#ÀaÃ&ÀÕ$JÔKØ
�‰Œ	Ø�‰�i •l BÔ'à×Ñ˜Ÿ™Ö%r   c                óv   € \         P                  ! R  4      pV P                  \        VP                  R4       R# )c                  ó   € R # r   r#   r#   r   r   r3   Ú(LoopTests.testBadDelay.<locals>.<lambda>Â  s   € ¡dr   Néÿÿÿÿ)r   rµ   r\   Ú
ValueErrorrÁ   )r   r$  s   & r   ÚtestBadDelayÚLoopTests.testBadDelayÁ  s(   € Ü×Ò™lÓ+ˆØ×Ñœ* b§h¡h°Ö3r   c                óö   a€ . oV3R  lp\         P                  ! 4       p\        W24      pVP                  VRR7       VP	                  4        V P                  S4       V P                  VP                  4       R# )c                  ó*   <€ S P                  R 4       R # r   rR   ©Úrans   €r   rø   Ú$LoopTests._stoppingTest.<locals>.fooÉ  ó   ø€ Ø�J‰J�tÖr   FrÞ   N)r   r(   r   rÁ   rõ   rE   r‚   )r   rk   rø   r   r$  r7  s   &&   @r   Ú_stoppingTestÚLoopTests._stoppingTestÆ  s]   ø€ Øˆõ	ô —
’
“ˆÜ  Ó,ˆØ
�‰�˜EˆÔ"Ø
�‰Œ	Ø×Ñ˜ÔØ×Ñ˜Ÿ™Ö%r   c                ó$   € V P                  ^ 4      # )r¿   ©r:  ©r   s   &r   ÚtestStopAtOnceÚLoopTests.testStopAtOnceÓ  s   € Ø×!Ñ! !Ó$Ð$r   c                ó$   € V P                  ^
4      # )é
   r=  r>  s   &r   ÚtestStoppingBeforeDelayedStartÚ(LoopTests.testStoppingBeforeDelayedStartÖ  s   € Ø×!Ñ! "Ó%Ð%r   c                óN  a€ . oV3R lp\         P                  ! 4       p\        W!4      pVP                  ^RR7       VP	                  ^4       VP                  4        VP	                  ^4       V P                  S. 4       VP	                  ^4       V P                  SR.4       R# )z(
Test that L{LoopingCall} can be reset.
c                  ó*   <€ S P                  R 4       R # r   rR   r6  s   €r   rø   Ú!LoopTests.test_reset.<locals>.fooß  r9  r   FrÞ   N)r   r(   r   rÁ   rV   rq   r)   )r   rø   r,   r$  r7  s   &   @r   Ú
test_resetÚLoopTests.test_resetÙ  s‚   ø€ ð ˆõ	ô �JŠJ‹LˆÜ  Ó(ˆØ
�‰�˜ˆÔØ	�	‰	�!ŒØ
�‰Œ
Ø	�	‰	�!ŒØ×Ñ˜˜bÔ!Ø	�	‰	�!ŒØ×Ñ˜˜t˜fÖ%r   c           
     ór   € V P                  \        \        P                  ! \        ^^R7      4      R4       R# )z?
L{LoopingCall.__repr__} includes the wrapped function's name.
)Úkeyz6LoopingCall<None>(installReactor, *(1,), **{'key': 2})N)r)   Úreprr   rµ   r   r>  s   &r   Útest_reprFunctionÚLoopTests.test_reprFunctionì  s,   € ð 	×ÑÜ”×!Ò!¤.°!¸Ô;Ó<ØDö	
r   c                ó€   € V P                  \        \        P                  ! \        P
                  4      4      R4       R# )zB
L{LoopingCall.__repr__} includes the wrapped method's full name.
z:LoopingCall<None>(TestableLoopingCall.__init__, *(), **{})N)r)   rL  r   rµ   r   r   r>  s   &r   Útest_reprMethodÚLoopTests.test_reprMethodõ  s/   € ð 	×ÑÜ”×!Ò!Ô"5×">Ñ">Ó?Ó@ØHö	
r   c                óD  € \         P                  ! R 4      pVP                   RpV P                  V P                  .4      pV P                  ^\        V4      4       V P                  \        V^ ,          R,          4       V P                  W#^ ,          R,          4       R# )z(
L{LoopingCall.deferred} is deprecated.
c                  ó   € R # r   r#   r#   r   r   r3   Ú4LoopTests.test_deferredDeprecation.<locals>.<lambda>  r~   r   z€twisted.internet.task.LoopingCall.deferred was deprecated in Twisted 16.0.0; please use the deferred returned by start() insteadÚcategoryÚmessageN)r   rµ   rû   ÚflushWarningsÚtest_deferredDeprecationr)   rô   ÚDeprecationWarning)r   r÷   rV  Úwarningss   &   r   rX  Ú"LoopTests.test_deferredDeprecationþ  s†   € ô ×Ò¡Ó-ˆà�ŠðBð 	ð
 ×%Ñ% t×'DÑ'DÐ&EÓFˆØ×Ñ˜œC ›MÔ*Ø×ÑÔ+¨X°a­[¸Õ-DÔEØ×Ñ˜¨1¥+¨iÕ"8Ö9r   r#   N)r   r   r   r   r®   r¶   rÂ   rÈ   rÔ   rÛ   rï   rü   r  r  r&  r+  r2  r:  r?  rC  rH  rM  rP  rX  r   r   r¯   s   @r   r±   r±   ð   sz   ø‡ € ñò
.ò2-òh +òD8
òt'OòR@)òD/ò4$/òLGGòR&&òP&ò04ò
&ò%ò&ò&ò&
ò
÷:ð :r   r±   c                   óP   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# )ÚReactorLoopTestsi  c                ó€   € R  p\         P                  ! VR4      pV P                  VP                  R4      \        4      # )c                 ó   € \        V 4      hr   ©r"   r{   s   &r   rø   Ú)ReactorLoopTests.testFailure.<locals>.foo  s   € Ü Ó"Ð"r   Úbarr  ©r   rµ   ÚassertFailurerÁ   r"   ©r   rø   r$  s   &  r   ÚtestFailureÚReactorLoopTests.testFailure  s6   € ò	#ô ×Ò˜c 5Ó)ˆØ×!Ñ! "§(¡(¨3£-´Ó?Ð?r   c                óˆ   a€ V3R  lp\         P                  ! VR4      oV P                  SP                  R4      \        4      # )c                 ó:   <€ SP                  4        \        V 4      hr   )rõ   r"   )r|   r$  s   &€r   rø   Ú-ReactorLoopTests.testFailAndStop.<locals>.foo  s   ø€ Ø�G‰GŒIÜ Ó"Ð"r   rb  r  rc  re  s   & @r   ÚtestFailAndStopÚ ReactorLoopTests.testFailAndStop  s7   ø€ õ	#ô ×Ò˜c 5Ó)ˆØ×!Ñ! "§(¡(¨3£-´Ó?Ð?r   c                ó˜   a aa€ . oVV3R  lp\         P                  ! V4      oSP                  ^ 4      pVV 3R lpVP                  V4      # )c                  ón   <€ SP                  R 4       \        S4      ^8”  d   S P                  4        R # R # r   ró   )r$  r7  s   €€r   rø   Ú0ReactorLoopTests.testEveryIteration.<locals>.foo&  s(   ø€ Ø�J‰J�tÔÜ�3‹x˜!Œ|Ø—‘–	ñ r   c                 ó>   <€ SP                  \        S4      ^4       R# )é   N)r)   rô   )Úignr7  r   s   &€€r   ÚstoppedÚ4ReactorLoopTests.testEveryIteration.<locals>.stopped.  s   ø€ Ø×ÑœS ›X qÖ)r   )r   rµ   rÁ   r   )r   rø   r  rs  r$  r7  s   f   @@r   ÚtestEveryIterationÚ#ReactorLoopTests.testEveryIteration#  sB   ú€ Øˆö	ô
 ×Ò˜cÓ"ˆØ�H‰H�Q‹Kˆö	*ð �}‰}˜WÓ%Ð%r   c                óò   a€ \         P                  ! 4       oV3R  lp\        P                  ! V4      V n        V P                  P                  ^RR7       \        P                  ! ^ V P                  S4       S# )c                  óR   <€ S P                  \        P                  ! R 4      4       R# )z'This task also should never get called.N)Úerrbackr
   ÚDefaultExceptionr  s   €r   rø   Ú1ReactorLoopTests.testStopAtOnceLater.<locals>.foo8  s   ø€ Ø�I‰IÜ×(Ò(Ð)RÓSör   FrÞ   )	r   r  r   rµ   Ú_lcrÁ   r   r7   Ú!_callback_for_testStopAtOnceLater)r   rø   r  s   & @r   ÚtestStopAtOnceLaterÚ$ReactorLoopTests.testStopAtOnceLater3  s[   ø€ ô �NŠNÓˆõ	ô
 ×#Ò# CÓ(ˆŒØ�‰�‰�q˜eˆÔ$Ü×Ò˜!˜T×CÑCÀQÔGØˆr   c                ó~   € V P                   P                  4        \        P                  ! ^ VP                  R4       R# )r¿   ÚsuccessN)r|  rõ   r   r7   r  )r   r  s   &&r   r}  Ú2ReactorLoopTests._callback_for_testStopAtOnceLaterB  s%   € Ø�‰�‰ŒÜ×Ò˜!˜QŸZ™Z¨Ö3r   c                óÜ   aa€ R R.p\         P                  ! 4       oVV3R lp\        SV4      oSP                  R 4       SP	                  V4       V P                  SP                  4       R# )çš™™™™™É?gš™™™™™é?c                  ó–   <€ \         P                  ! 4       p V P                  V3R  l4       SP                  ^V P                  R4       V # )c                 ó$   <€ SP                  4       # r   )rõ   )Ú_r$  s   &€r   r3   Ú@ReactorLoopTests.testWaitDeferred.<locals>.foo.<locals>.<lambda>N  s   ø€  B§G¡G¤Ir   N)r   r  r   r7   r  )r  r   r$  s    €€r   rø   Ú.ReactorLoopTests.testWaitDeferred.<locals>.fooL  s5   ø€ Ü—’Ó ˆAØ�M‰MÔ-Ô.Ø�O‰O˜A˜qŸz™z¨4Ô0ØˆHr   N)r   r(   r   rÁ   r™   rE   r‚   )r   r#  rø   r   r$  s   &  @@r   ÚtestWaitDeferredÚ!ReactorLoopTests.testWaitDeferredF  sU   ù€ ð ˜�*ˆÜ—
’
“ˆö	ô ! ¨Ó,ˆØ
�‰�ŒØ�
‰
�7ÔØ×Ñ˜Ÿ™Ö%r   c                ó  a€ R .p\         P                  ! 4       oV3R lp\        SV4      pVP                  ^4      pV P	                  V\
        4       SP                  V4       V P                  SP                  4       V# )ç333333Ó?c                  ó|   <€ \         P                  ! 4       p SP                  R V P                  \	        4       4       V # )r�  )r   r  r7   ry  r"   )r  r   s    €r   rø   Ú4ReactorLoopTests.testFailurePropagation.<locals>.fooa  s*   ø€ Ü—’Ó ˆAØ�O‰O˜C §¡¬M«OÔ<ØˆHr   )	r   r(   r   rÁ   rd  r"   r™   rE   r‚   )r   r#  rø   r$  r  r   s   &    @r   ÚtestFailurePropagationÚ'ReactorLoopTests.testFailurePropagationW  sj   ø€ ð �%ˆÜ—
’
“ˆõ	ô
 ! ¨Ó,ˆØ�H‰H�Q‹KˆØ×Ñ˜1œmÔ,à�
‰
�7ÔØ×Ñ˜Ÿ™Ô%Øˆr   c                ó  aa€ \         P                  ! 4       p\        P                  ! 4       o. oVV3R lp\         P                  P                  V4      pWn        VP                  RRR7      oV P                  S. 4       VP                  RR.4       V P                  \        S4      ^4       SP                  R4       VP                  R.4       V P                  \        S4      ^4       V P                  S^^.4       R# )a  
In the case that the function passed to L{LoopingCall.withCount}
returns a deferred, which does not fire before the next interval
elapses, the function should not be run again. And if a function call
is skipped in this fashion, the appropriate count should be
provided.
c                 óN   <€ SP                  V 4       \        S4      ^8X  d   S# R# ©ri   Nr  )ÚpossibleCountr  ÚdeferredCountss   &€€r   ÚcountTrackerÚ=ReactorLoopTests.test_deferredWithCount.<locals>.countTrackerz  s&   ø€ à×!Ñ! -Ô0ä�>Ó" aÔ'Ø�ár   r„  FrÞ   gš™™™™™Ù?N)r   r(   r   r  rµ   rÐ   r   rÁ   r)   r™   rô   r  )r   Ú	testClockr—  r$  r  r–  s   &   @@r   Útest_deferredWithCountÚ'ReactorLoopTests.test_deferredWithCountn  sÕ   ù€ ô —J’J“Lˆ	Ü�NŠNÓˆØˆö	ô ×Ñ×'Ñ'¨Ó5ˆØŒØ�H‰H�S˜eˆHÓ$ˆð 	×Ñ˜¨Ô,ð 	�‰˜˜S�zÔ"à×Ñœ˜^Ó,¨aÔ0ð 	
�
‰
�4ÔØ�‰˜�uÔà×Ñœ˜^Ó,¨aÔ0ð 	×Ñ˜¨!¨Q¨Ö0r   )r|  N)r   r   r   r   rf  rk  ru  r~  r}  rŠ  r�  rš  r   r   r¯   s   @r   r]  r]    s4   ø‡ € ò@ò@ò&ò ò4ò&ò"÷.*1ð *1r   r]  c                   ó<   a € ] tR tRt o RtR tR tR tR tRt	V t
R# )	ÚDeferLaterTestsi›  z
Tests for L{task.deferLater}.
c                óV  aa€ . o\        4       oVV3R lp\        P                  ! 4       p\        P                  ! V^VRRR7      pVP	                  V P
                  S4       VP                  ^4       V P                  S. 4       VP                  ^4       V P                  SR.4       V# )z„
The L{Deferred} returned by L{task.deferLater} is called back after
the specified delay with the result of the function passed in.
c                 ó,   <€ SP                  W34       S# r   rR   )rø   rb  ÚflagÚresultss   &&€€r   ÚcallableÚ/DeferLaterTests.test_callback.<locals>.callable¨  s   ø€ Ø�N‰N˜C˜:Ô&ØˆKr   rø   rb  )rb  )rø   rb  )Úobjectr   r(   Ú
deferLaterr   r"  rV   r)   )r   r¢  r   r  r   r¡  s   &   @@r   Útest_callbackÚDeferLaterTests.test_callback   s‹   ù€ ð
 ˆÜ‹xˆö	ô —
’
“ˆÜ�OŠO˜E 1 h°¸5ÔAˆØ	�‰�d—m‘m TÔ*Ø�‰�aÔØ×Ñ˜ "Ô%Ø�‰�aÔØ×Ñ˜ >Ð"2Ô3Øˆr   c                ó°   € R p\         P                  ! 4       p\         P                  ! V^V4      pVP                  ^4       V P	                  V\
        4      # )zk
The L{Deferred} returned by L{task.deferLater} is errbacked if the
supplied function raises an exception.
c                  ó   € \        4       hr   r`  r#   r   r   r¢  Ú.DeferLaterTests.test_errback.<locals>.callable»  s
   € Ü“/Ð!r   )r   r(   r¥  rV   rd  r"   )r   r¢  r   r  s   &   r   Útest_errbackÚDeferLaterTests.test_errbackµ  sE   € ò	"ô —
’
“ˆÜ�OŠO˜E 1 hÓ/ˆØ�‰�aÔØ×!Ñ! !¤]Ó3Ð3r   c                ó  a aa€ . o\         P                  ! 4       o\         P                  ! S^SP                  R4      pVP	                  4        VVV 3R lpS P                  V\        P                  4       VP                  V4       V# )zt
The L{Deferred} returned by L{task.deferLater} can be
cancelled to prevent the call from actually being performed.
Nc                 ój   <€ SP                  . SP                  4       4       SP                  S4       R # r   )r)   r€   rE   )ÚignoredÚcalledr   r   s   &€€€r   ÚcbCancelledÚ0DeferLaterTests.test_cancel.<locals>.cbCancelledÍ  s*   ø€ à×Ñ˜R ×!6Ñ!6Ó!8Ô9à×Ñ˜VÖ$r   )	r   r(   r¥  rS   rD   rd  r   ÚCancelledErrorr   )r   r  r±  r°  r   s   f  @@r   Útest_cancelÚDeferLaterTests.test_cancelÃ  sd   ú€ ð
 ˆÜ—
’
“ˆÜ�OŠO˜E 1 f§m¡m°TÓ:ˆØ	�‰Œ
÷	%ð 	×Ñ˜1œe×2Ñ2Ô3Ø	�‰�kÔ"Øˆr   c                óä   € \         P                  ! 4       p\         P                  ! VR4      pV P                  V4       VP	                  R4       V P                  RV P                  V4      4       R# )zh
The L{Deferred} returned by L{task.deferLater} fires with C{None}
when no callback function is passed.
r�   N)r   r(   r¥  ÚassertNoResultrV   r"  rú   )r   r   r  s   &  r   Útest_noCallbackÚDeferLaterTests.test_noCallback×  sR   € ô
 —
’
“ˆÜ�OŠO˜E 3Ó'ˆØ×Ñ˜AÔà�‰�cÔØ�‰�d˜D×0Ñ0°Ó3Ö4r   r#   N)r   r   r   r   r®   r¦  r«  r´  r¸  r   r   r¯   s   @r   r�  r�  ›  s#   ø‡ € ñòò*4ò÷(
5ð 
5r   r�  c                   ó>   a € ] tR tRt o R tR tR tR tR tRt	V t
R# )	Ú_FakeReactoriä  c                ó  € R V n         \        P                  ! 4       V n        V P                  P                  V n        V P                  P
                  V n        V P                  P                  V n        . V n        R. R. /V n        R# )FÚbeforeÚduringN)	Ú_runningr   r(   Ú_clockr7   r*   r€   Ú_whenRunningÚ_shutdownTriggersr>  s   &r   r   Ú_FakeReactor.__init__å  sc   € ØˆŒÜ—j’j“lˆŒØŸ™×.Ñ.ˆŒØ—{‘{×*Ñ*ˆŒØ#Ÿ{™{×:Ñ:ˆÔØˆÔØ"*¨B°¸"Ð!=ˆÖr   c                óp   € V P                   f   V! V/ VB  R # V P                   P                  WV34       R # r   )rÁ  rS   )r   r¢  ÚargsÚkwargss   &&*,r   ÚcallWhenRunningÚ_FakeReactor.callWhenRunningî  s4   € Ø×ÑÒ$Ù�dÐ%˜fÔ%à×Ñ×$Ñ$ h°fÐ%=Ö>r   c                óp   € VR9   g   Q hVR8X  g   Q hV P                   V,          P                  W434       R# )r½  ÚshutdownN)r½  r¾  )rÂ  rS   )r   ÚphaseÚeventr¢  rÅ  s   &&&&*r   ÚaddSystemEventTriggerÚ"_FakeReactor.addSystemEventTriggerô  s;   € ØÐ,Ô,Ð,Ð,Ø˜
Ô"Ð"Ð"Ø×Ñ˜uÕ%×,Ñ,¨hÐ-=Ö>r   c                óÌ  € RV n         V P                  pRV n        V F  w  r#pV! V/ VB  K  	  V P                   '       dk   V P                  4       pV'       g   \        R4      hV P                  P                  V^ ,          P                  4       V P                  4       ,
          4       K|  V P                  pRV n        VR,          VR,          ,            F  w  rsV! V!   K  	  R# )z 
Call timed events until there are no more or the reactor is stopped.

@raise RuntimeError: When no timed events are left and the reactor is
    still running.
TNzNo DelayedCalls leftr½  r¾  )	r¿  rÁ  r€   ÚRuntimeErrorrÀ  rV   r;   r*   rÂ  )r   ÚwhenRunningr¢  rÅ  rÆ  r‚   ÚshutdownTriggersÚtriggers   &       r   ÚrunÚ_FakeReactor.runù  sÅ   € ð ˆŒØ×'Ñ'ˆØ ˆÔÛ&1Ñ"ˆH˜FÙ�dÐ%˜fÔ%ñ '2à�m�mˆmØ×(Ñ(Ó*ˆEßÜ"Ð#9Ó:Ð:Ø�K‰K×Ñ  a¥× 0Ñ 0Ó 2°T·\±\³^Õ CÖDØ×1Ñ1ÐØ!%ˆÔØ-¨hÕ7Ð:JÈ8Õ:T×TÐT‰MˆGÙ�TŒNó Ur   c                ób   € V P                   '       g   \        P                  ! 4       hRV n         R# )z
Stop the reactor.
FN)r¿  r   ÚReactorNotRunningr>  s   &r   rõ   Ú_FakeReactor.stop  s#   € ð �}�}ˆ}Ü×)Ò)Ó+Ð+ØˆŽr   )rÀ  r¿  rÂ  rÁ  r7   r€   r*   N)r   r   r   r   r   rÇ  rÍ  rÔ  rõ   r   r   r¯   s   @r   r»  r»  ä  s#   ø‡ € ò>ò?ò?ò
÷,ð r   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R
 tR tR tR tRtV tR# )Ú
ReactTestsi  z+
Tests for L{twisted.internet.task.react}.
c                ó  a€ . oV3R lp\        4       pV P                  \        \        P                  WR7      pV P                  ^ VP                  4       V P                  SR.4       V P                  VP                  4       ^4       R# )ú{
L{task.react} runs the reactor until the L{Deferred} returned by the
function it is passed is called back, then stops it.
c                 óª   <€ \         P                  ! 4       pV P                  ! ^SP                  R4       V P                  ! ^VP                  R4       V# ©ri   TN©r   r  r7   rS   r  ©r   ÚfinishedÚ
timePasseds   & €r   ÚmainÚ4ReactTests.test_runsUntilAsyncCallback.<locals>.main$  sD   ø€ Ü—~’~Ó'ˆHØ×Ò˜a ×!2Ñ!2°DÔ9Ø×Ò˜a ×!2Ñ!2°DÔ9ØˆOr   ©Ú_reactorTN©r»  r\   Ú
SystemExitr   Úreactr)   Úcoder*   ©r   rã  ÚrÚ	exitErrorrâ  s   &   @r   Útest_runsUntilAsyncCallbackÚ&ReactTests.test_runsUntilAsyncCallback  so   ø€ ð
 ˆ
õ	ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜˜IŸN™NÔ+Ø×Ñ˜ d VÔ,Ø×Ñ˜Ÿ™› aÖ(r   c                óä   € R p\        4       pV P                  \        \        P                  WR7      pV P                  ^ VP                  4       V P                  VP                  4       ^ 4       R# )ú‘
L{task.react} returns quickly if the L{Deferred} returned by the
function it is passed has already been called back at the time it is
returned.
c                 ó.   € \         P                  ! R 4      # r   ©r   Úsucceed©r   s   &r   rã  Ú3ReactTests.test_runsUntilSyncCallback.<locals>.main7  s   € Ü—=’= Ó&Ð&r   rå  Nrç  ©r   rã  rì  rí  s   &   r   Útest_runsUntilSyncCallbackÚ%ReactTests.test_runsUntilSyncCallback0  sU   € ò	'ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜˜IŸN™NÔ+Ø×Ñ˜Ÿ™› aÖ(r   c                ó"  a€  ! R R\         4      oV3R lp\        4       pV P                  \        \        P
                  WR7      pV P                  ^VP                  4       V P                  S4      pV P                  \        V4      ^4       R# )ú¡
L{task.react} runs the reactor until the L{defer.Deferred} returned by
the function it is passed is errbacked, then it stops the reactor and
reports the error.
c                   ó   € ] tR tRtRtR# )Ú@ReactTests.test_runsUntilAsyncErrback.<locals>.ExpectedExceptioniF  r#   Nr$   r#   r   r   ÚExpectedExceptionrý  F  ó   † Ûr   rþ  c                 óx   <€ \         P                  ! 4       pV P                  ! ^VP                  S! 4       4       V# ©ri   ©r   r  r7   ry  ©r   rá  rþ  s   & €r   rã  Ú3ReactTests.test_runsUntilAsyncErrback.<locals>.mainI  s0   ø€ Ü—~’~Ó'ˆHØ×Ò˜a ×!1Ñ!1Ñ3DÓ3FÔGØˆOr   rå  N©
Ú	Exceptionr»  r\   rè  r   ré  r)   rê  ÚflushLoggedErrorsrô   ©r   rã  rì  rí  Úerrorsrþ  s   &    @r   Útest_runsUntilAsyncErrbackÚ%ReactTests.test_runsUntilAsyncErrback?  sq   ø€ ô	¤	ô 	õ	ô
 ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	à×Ñ˜˜IŸN™NÔ+à×'Ñ'Ð(9Ó:ˆØ×Ñœ˜V› aÖ(r   c                ób  a€  ! R R\         4      oV3R lp\        4       pV P                  \        \        P
                  WR7      pV P                  ^VP                  4       V P                  VP                  4       ^ 4       V P                  S4      pV P                  \        V4      ^4       R# )ú•
L{task.react} returns quickly if the L{defer.Deferred} returned by the
function it is passed has already been errbacked at the time it is
returned.
c                   ó   € ] tR tRtRtR# )Ú?ReactTests.test_runsUntilSyncErrback.<locals>.ExpectedExceptioni]  r#   Nr$   r#   r   r   rþ  r  ]  rÿ  r   rþ  c                 ó:   <€ \         P                  ! S! 4       4      # r   ©r   Úfail©r   rþ  s   &€r   rã  Ú2ReactTests.test_runsUntilSyncErrback.<locals>.main`  s   ø€ Ü—:’:Ñ/Ó1Ó2Ð2r   rå  N©r  r»  r\   rè  r   ré  r)   rê  r*   r  rô   r  s   &    @r   Útest_runsUntilSyncErrbackÚ$ReactTests.test_runsUntilSyncErrbackV  s‡   ø€ ô	¤	ô 	õ	3ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜˜IŸN™NÔ+Ø×Ñ˜Ÿ™› aÔ(Ø×'Ñ'Ð(9Ó:ˆØ×Ñœ˜V› aÖ(r   c                óä   € R p\        4       pV P                  \        \        P                  WR7      pV P                  VP                  4       ^4       V P                  ^ VP                  4       R# )ú�
L{task.react} doesn't try to stop the reactor if the L{defer.Deferred}
the function it is passed is called back after the reactor has already
been stopped.
c                 ó¨   € V P                   ! ^V P                  4       \        P                  ! 4       pV P                  ! RRVP
                  R4       V# ©ri   r¾  rÊ  N©r7   rõ   r   r  rÍ  r  ©r   rá  s   & r   rã  Ú0ReactTests.test_singleStopCallback.<locals>.mainq  sB   € Ø×Ò˜a §¡Ô.Ü—~’~Ó'ˆHØ×)Ò)¨(°JÀ×@QÑ@QÐSWÔXØˆOr   rå  N©r»  r\   rè  r   ré  r)   r*   rê  r÷  s   &   r   Útest_singleStopCallbackÚ"ReactTests.test_singleStopCallbackj  sU   € ò	ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜Ÿ™› aÔ(à×Ñ˜˜IŸN™NÖ+r   c                ób  a€  ! R R\         4      oV3R lp\        4       pV P                  \        \        P
                  WR7      pV P                  ^VP                  4       V P                  VP                  4       ^4       V P                  S4      pV P                  \        V4      ^4       R# )ú›
L{task.react} doesn't try to stop the reactor if the L{defer.Deferred}
the function it is passed is errbacked after the reactor has already
been stopped.
c                   ó   € ] tR tRtRtR# )Ú<ReactTests.test_singleStopErrback.<locals>.ExpectedExceptioni„  r#   Nr$   r#   r   r   rþ  r%  „  rÿ  r   rþ  c                 ó´   <€ V P                   ! ^V P                  4       \        P                  ! 4       pV P                  ! RRVP
                  S! 4       4       V# )ri   r¾  rÊ  ©r7   rõ   r   r  rÍ  ry  r  s   & €r   rã  Ú/ReactTests.test_singleStopErrback.<locals>.main‡  sK   ø€ Ø×Ò˜a §¡Ô.Ü—~’~Ó'ˆHØ×)Ò)Ø˜* h×&6Ñ&6Ñ8IÓ8Kôð ˆOr   rå  Nr  r  s   &    @r   Útest_singleStopErrbackÚ!ReactTests.test_singleStopErrback}  s‡   ø€ ô	¤	ô 	õ	ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	à×Ñ˜˜IŸN™NÔ+à×Ñ˜Ÿ™› aÔ(Ø×'Ñ'Ð(9Ó:ˆØ×Ñœ˜V› aÖ(r   c                óà   a€ . oV3R lp\        4       pV P                  \        \        P                  V. ROVR7      pV P                  ^ VP                  4       V P                  S. RO4       R# )úr
L{task.react} passes the elements of the list it is passed as
positional arguments to the function it is passed.
c                 óV   <€ SP                  WV34       \        P                  ! R 4      # r   ©Úextendr   rô  ©r   r|   ÚyÚzrÅ  s   &&&&€r   rã  Ú'ReactTests.test_arguments.<locals>.mainŸ  s"   ø€ Ø�K‰K˜˜q˜	Ô"Ü—=’= Ó&Ð&r   rå  N©ri   rj   rÇ   ©r»  r\   rè  r   ré  r)   rê  ©r   rã  rì  rí  rÅ  s   &   @r   Útest_argumentsÚReactTests.test_arguments˜  sb   ø€ ð
 ˆõ	'ô ‹NˆØ×%Ñ%ÜœŸ
™
 Dª)¸að &ó 
ˆ	ð 	×Ñ˜˜IŸN™NÔ+Ø×Ñ˜šyÖ)r   c                óV  a € V 3R lp\        4       p\        4       ;_uu_ 4        \        V4       S P                  \        \
        P                  V. 4      pS P                  ^ VP                  4       RRR4       S P                  VS P                  4       R#   + '       g   i     L.; i)úX
L{twisted.internet.reactor} is used if no reactor argument is passed to
L{task.react}.
c                 ó>   <€ V Sn         \        P                  ! R 4      # r   ©ÚpassedReactorr   rô  ©r   r   s   &€r   rã  Ú,ReactTests.test_defaultReactor.<locals>.main°  s   ø€ Ø!(ˆDÔÜ—=’= Ó&Ð&r   N©r»  r   r   r\   rè  r   ré  r)   rê  r"  r=  ©r   rã  r   rí  s   f   r   Útest_defaultReactorÚReactTests.test_defaultReactorª  sq   ø€ õ	'ô “.ˆÜ�[�[Ü˜7Ô#Ø×)Ñ)¬*´d·j±jÀ$ÈÓKˆIØ×Ñ˜Q 	§¡Ô/÷ ð 	�‰�g˜t×1Ñ1Ö2÷	 �[úó   ¤ABÂB(	c                ó¨   € R p\        4       pV P                  \        \        P                  V. VR7      pV P                  ^VP                  4       R# )út
L{task.react} forwards the exit code specified by the C{SystemExit}
error returned by the passed function, if any.
c                 ó@   € \         P                  ! \        ^4      4      # )é   ©r   r  rè  rõ  s   &r   rã  Ú1ReactTests.test_exitWithDefinedCode.<locals>.mainÁ  s   € Ü—:’:œj¨›nÓ-Ð-r   rå  Nr5  r÷  s   &   r   Útest_exitWithDefinedCodeÚ#ReactTests.test_exitWithDefinedCode»  sD   € ò	.ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÀBÐQRÐ%ÓSˆ	Ø×Ñ˜˜YŸ^™^Ö,r   c                ó¨   € R p\        4       pV P                  \        \        P                  V. VR7      pV P                  ^ VP                  4       R# )ú_
L{task.react} handles when the reactor is stopped just before the
returned L{Deferred} fires.
c                 óf   a a€ \         P                  ! 4       oVV 3R  lpS P                  ! V4       S# )c                  óL   <€ SP                   ! 4        S P                  R 4       R # r   ©rõ   r  ©r  r   s   €€r   rõ   Ú;ReactTests.test_synchronousStop.<locals>.main.<locals>.stopÑ  ó   ø€ Ø—’”Ø—
‘
˜4Ö r   ©r   r  rÇ  ©r   rõ   r  s   f @r   rã  Ú-ReactTests.test_synchronousStop.<locals>.mainÎ  s)   ù€ Ü—’Ó ˆAö!ð ×#Ò# DÔ)ØˆHr   rå  Nr5  r÷  s   &   r   Útest_synchronousStopÚReactTests.test_synchronousStopÈ  sD   € ò	ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÀBÐQRÐ%ÓSˆ	Ø×Ñ˜˜IŸN™NÖ+r   c                ó¨   € R p\        4       pV P                  \        \        P                  V. VR7      pV P                  ^ VP                  4       R# )ú^
L{task.react} handles when the reactor is stopped and the
returned L{Deferred} doesn't fire.
c                 óf   € V P                   ! ^V P                  4       \        P                  ! 4       # r  ©r7   rõ   r   r  rõ  s   &r   rã  Ú.ReactTests.test_asynchronousStop.<locals>.mainâ  s#   € Ø×Ò˜a §¡Ô.Ü—>’>Ó#Ð#r   rå  Nr5  r÷  s   &   r   Útest_asynchronousStopÚ ReactTests.test_asynchronousStopÜ  sD   € ò	$ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÀBÐQRÐ%ÓSˆ	Ø×Ñ˜˜IŸN™NÖ+r   ©r=  N©r   r   r   r   r®   rî  rø  r
  r  r   r)  r7  rB  rK  rX  r_  r   r   r¯   s   @r   rÚ  rÚ    óF   ø‡ € ñò)ò&)ò)ò.)ò(,ò&)ò6*ò$3ò"-ò,÷(,ð ,r   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R
 tR tR tR tRtV tR# )ÚReactCoroutineFunctionTestsië  zH
Tests for L{twisted.internet.task.react} with an C{async def} argument
c                ó  a€ . oV3R lp\        4       pV P                  \        \        P                  WR7      pV P                  ^ VP                  4       V P                  SR.4       V P                  VP                  4       ^4       R# )rÜ  c              “   óÆ   <"  € \         P                  ! 4       pV P                  ! ^SP                  R4       V P                  ! ^VP                  R4       VG Rj  x€L
 #  L5irÞ  rß  rà  s   & €r   rã  ÚEReactCoroutineFunctionTests.test_runsUntilAsyncCallback.<locals>.main÷  sL   øé € Ü—~’~Ó'ˆHØ×Ò˜a ×!2Ñ!2°DÔ9Ø×Ò˜a ×!2Ñ!2°DÔ9Ø!—>Ð!‘>ùs   ƒAA!ÁAÁA!rå  TNrç  rë  s   &   @r   rî  Ú7ReactCoroutineFunctionTests.test_runsUntilAsyncCallbackð  so   ø€ ð
 ˆ
õ	"ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜˜IŸN™NÔ+Ø×Ñ˜ d VÔ,Ø×Ñ˜Ÿ™› aÖ(r   c                óä   € R p\        4       pV P                  \        \        P                  WR7      pV P                  ^ VP                  4       V P                  VP                  4       ^ 4       R# )rñ  c              “   óJ   "  € \         P                  ! R 4      G R j  x€L
 #  L5ir   ró  rõ  s   &r   rã  ÚDReactCoroutineFunctionTests.test_runsUntilSyncCallback.<locals>.main
  s   é € ÜŸš tÓ,×,Ð,Ñ,ùs   ‚#œ!�#rå  Nrç  r÷  s   &   r   rø  Ú6ReactCoroutineFunctionTests.test_runsUntilSyncCallback  sU   € ò	-ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜˜IŸN™NÔ+Ø×Ñ˜Ÿ™› aÖ(r   c                ó"  a€  ! R R\         4      oV3R lp\        4       pV P                  \        \        P
                  WR7      pV P                  ^VP                  4       V P                  S4      pV P                  \        V4      ^4       R# )rû  c                   ó   € ] tR tRtRtR# )ÚQReactCoroutineFunctionTests.test_runsUntilAsyncErrback.<locals>.ExpectedExceptioni  r#   Nr$   r#   r   r   rþ  rp    rÿ  r   rþ  c              “   ó”   <"  € \         P                  ! 4       pV P                  ! ^VP                  S! 4       4       VG Rj  x€L
 #  L5ir”  r  r  s   & €r   rã  ÚDReactCoroutineFunctionTests.test_runsUntilAsyncErrback.<locals>.main  s8   øé € Ü—~’~Ó'ˆHØ×Ò˜a ×!1Ñ!1Ñ3DÓ3FÔGØ!—>Ð!‘>ùs   ƒ>AÁAÁArå  Nr  r  s   &    @r   r
  Ú6ReactCoroutineFunctionTests.test_runsUntilAsyncErrback  sq   ø€ ô	¤	ô 	õ	"ô
 ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	à×Ñ˜˜IŸN™NÔ+à×'Ñ'Ð(9Ó:ˆØ×Ñœ˜V› aÖ(r   c                ób  a€  ! R R\         4      oV3R lp\        4       pV P                  \        \        P
                  WR7      pV P                  ^VP                  4       V P                  VP                  4       ^ 4       V P                  S4      pV P                  \        V4      ^4       R# )r  c                   ó   € ] tR tRtRtR# )ÚPReactCoroutineFunctionTests.test_runsUntilSyncErrback.<locals>.ExpectedExceptioni0  r#   Nr$   r#   r   r   rþ  rv  0  rÿ  r   rþ  c              “   óV   <"  € \         P                  ! S! 4       4      G R j  x€L
 #  L5ir   r  r  s   &€r   rã  ÚCReactCoroutineFunctionTests.test_runsUntilSyncErrback.<locals>.main3  s   øé € ÜŸšÑ$5Ó$7Ó8×8Ð8Ñ8ùs   ƒ)¢'£)rå  Nr  r  s   &    @r   r  Ú5ReactCoroutineFunctionTests.test_runsUntilSyncErrback)  s‡   ø€ ô	¤	ô 	õ	9ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜˜IŸN™NÔ+Ø×Ñ˜Ÿ™› aÔ(Ø×'Ñ'Ð(9Ó:ˆØ×Ñœ˜V› aÖ(r   c                óä   € R p\        4       pV P                  \        \        P                  WR7      pV P                  VP                  4       ^4       V P                  ^ VP                  4       R# )r  c              “   óÄ   "  € V P                   ! ^V P                  4       \        P                  ! 4       pV P                  ! RRVP
                  R4       VG Rj  x€L
 #  L5ir  r  r  s   & r   rã  ÚAReactCoroutineFunctionTests.test_singleStopCallback.<locals>.mainD  sJ   é € Ø×Ò˜a §¡Ô.Ü—~’~Ó'ˆHØ×)Ò)¨(°JÀ×@QÑ@QÐSWÔXØ!—>Ð!‘>ùs   ‚AA ÁAÁA rå  Nr  r÷  s   &   r   r   Ú3ReactCoroutineFunctionTests.test_singleStopCallback=  sU   € ò	"ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	Ø×Ñ˜Ÿ™› aÔ(à×Ñ˜˜IŸN™NÖ+r   c                ób  a€  ! R R\         4      oV3R lp\        4       pV P                  \        \        P
                  WR7      pV P                  ^VP                  4       V P                  VP                  4       ^4       V P                  S4      pV P                  \        V4      ^4       R# )r#  c                   ó   € ] tR tRtRtR# )ÚMReactCoroutineFunctionTests.test_singleStopErrback.<locals>.ExpectedExceptioniW  r#   Nr$   r#   r   r   rþ  r€  W  rÿ  r   rþ  c              “   óÐ   <"  € V P                   ! ^V P                  4       \        P                  ! 4       pV P                  ! RRVP
                  S! 4       4       VG Rj  x€L
 #  L5ir  r'  r  s   & €r   rã  Ú@ReactCoroutineFunctionTests.test_singleStopErrback.<locals>.mainZ  sS   øé € Ø×Ò˜a §¡Ô.Ü—~’~Ó'ˆHØ×)Ò)Ø˜* h×&6Ñ&6Ñ8IÓ8Kôð "—>Ð!‘>ùs   ƒAA&ÁA$Á A&rå  Nr  r  s   &    @r   r)  Ú2ReactCoroutineFunctionTests.test_singleStopErrbackP  s‡   ø€ ô	¤	ô 	õ	"ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÐ%ÓOˆ	à×Ñ˜˜IŸN™NÔ+à×Ñ˜Ÿ™› aÔ(Ø×'Ñ'Ð(9Ó:ˆØ×Ñœ˜V› aÖ(r   c                óà   a€ . oV3R lp\        4       pV P                  \        \        P                  V. ROVR7      pV P                  ^ VP                  4       V P                  S. RO4       R# )r,  c              “   ór   <"  € SP                  WV34       \        P                  ! R 4      G R j  x€L
 #  L5ir   r.  r0  s   &&&&€r   rã  Ú8ReactCoroutineFunctionTests.test_arguments.<locals>.mainr  s+   øé € Ø�K‰K˜˜q˜	Ô"ÜŸš tÓ,×,Ð,Ñ,ùs   ƒ-7°5±7rå  Nr4  r5  r6  s   &   @r   r7  Ú*ReactCoroutineFunctionTests.test_argumentsk  sb   ø€ ð
 ˆõ	-ô ‹NˆØ×%Ñ%ÜœŸ
™
 Dª)¸að &ó 
ˆ	ð 	×Ñ˜˜IŸN™NÔ+Ø×Ñ˜šyÖ)r   c                óV  a € V 3R lp\        4       p\        4       ;_uu_ 4        \        V4       S P                  \        \
        P                  V. 4      pS P                  ^ VP                  4       RRR4       S P                  VS P                  4       R#   + '       g   i     L.; i)r:  c              “   óZ   <"  € V Sn         \        P                  ! R 4      G R j  x€L
 #  L5ir   r<  r>  s   &€r   rã  Ú=ReactCoroutineFunctionTests.test_defaultReactor.<locals>.mainƒ  s#   øé € Ø!(ˆDÔÜŸš tÓ,×,Ð,Ñ,ùs   ƒ!+¤)¥+Nr@  rA  s   f   r   rB  Ú/ReactCoroutineFunctionTests.test_defaultReactor}  sq   ø€ õ	-ô “.ˆÜ�[�[Ü˜7Ô#Ø×)Ñ)¬*´d·j±jÀ$ÈÓKˆIØ×Ñ˜Q 	§¡Ô/÷ ð 	�‰�g˜t×1Ñ1Ö2÷	 �[úrD  c                ó¨   € R p\        4       pV P                  \        \        P                  V. VR7      pV P                  ^VP                  4       R# )rF  c              “   ó\   "  € \         P                  ! \        ^4      4      G Rj  x€L
 #  L5i)rH  NrI  rõ  s   &r   rã  ÚBReactCoroutineFunctionTests.test_exitWithDefinedCode.<locals>.main”  s   é € ÜŸš¤J¨r£NÓ3×3Ð3Ñ3ùs   ‚#,¥*¦,rå  Nr5  r÷  s   &   r   rK  Ú4ReactCoroutineFunctionTests.test_exitWithDefinedCodeŽ  sD   € ò	4ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÀBÐQRÐ%ÓSˆ	Ø×Ñ˜˜YŸ^™^Ö,r   c                ó¨   € R p\        4       pV P                  \        \        P                  V. VR7      pV P                  ^ VP                  4       R# )rN  c              “   ó‚   a a"  € \         P                  ! 4       oVV 3R  lpS P                  ! V4       SG Rj  x€L
 #  L5i)c                  óL   <€ SP                   ! 4        S P                  R 4       R # r   rQ  rR  s   €€r   rõ   ÚLReactCoroutineFunctionTests.test_synchronousStop.<locals>.main.<locals>.stop¤  rT  r   NrU  rV  s   f @r   rã  Ú>ReactCoroutineFunctionTests.test_synchronousStop.<locals>.main¡  s0   ùé € Ü—’Ó ˆAö!ð ×#Ò# DÔ)Ø—7ˆN‘7ùs   „4?¸=¹?rå  Nr5  r÷  s   &   r   rX  Ú0ReactCoroutineFunctionTests.test_synchronousStop›  sD   € ò	ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÀBÐQRÐ%ÓSˆ	Ø×Ñ˜˜IŸN™NÖ+r   c                ó¨   € R p\        4       pV P                  \        \        P                  V. VR7      pV P                  ^ VP                  4       R# )r[  c              “   ó‚   "  € V P                   ! ^V P                  4       \        P                  ! 4       G Rj  x€L
 #  L5ir”  r]  rõ  s   &r   rã  Ú?ReactCoroutineFunctionTests.test_asynchronousStop.<locals>.mainµ  s,   é € Ø×Ò˜a §¡Ô.ÜŸšÓ)×)Ð)Ñ)ùs   ‚6?¸=¹?rå  Nr5  r÷  s   &   r   r_  Ú1ReactCoroutineFunctionTests.test_asynchronousStop¯  sD   € ò	*ô ‹NˆØ×%Ñ%¤j´$·*±*¸dÀBÐQRÐ%ÓSˆ	Ø×Ñ˜˜IŸN™NÖ+r   ra  Nrb  r¯   s   @r   re  re  ë  rc  r   re  N)r®   Útwisted.internetr   r   r   r   r   Útwisted.internet.mainr   Ú#twisted.internet.test.modulehelpersr   Útwisted.trialr	   r(   Útwisted.pythonr
   rµ   r   r  r"   ÚTestCaser&   r±   r]  r�  r»  ÚSynchronousTestCaserÚ  re  r#   r   r   Ú<module>r¡     sÐ   ðñ÷
 EÕ DÝ 0Ý 9Ý "ð 	�
‰
€å "ô˜$×*Ñ*ô ô	�Iô 	ôO+�×"Ñ"ô O+ôd^:�×!Ñ!ô ^:ôBG1�x×(Ñ(ô G1ôTF5�h×'Ñ'ô F5÷R1ñ 1ôhP,�×-Ñ-ô P,ôfP, (×">Ñ">ö P,r   