+
    üÐj`  ã                   óÂ   € ^ RI HtHt ^ RIHt ^RIHt ]'       d   ]tM]tR R lt	]	! 4         ! R R]]4      t
]! 4       P                  ]
P                  4       4       R# )	é    )ÚTYPE_CHECKINGÚList)ÚSynchronousTestCase)ÚReactorBuilderc                ó   € V ^8„  d   QhRR/# ©é   ÚreturnN© )Úformats   "ÚF/usr/lib/python3/dist-packages/twisted/internet/test/test_cfreactor.pyÚ__annotate__r      s   € ÷ ñ ˆdñ ó    c                 ó   € R# )z(
Do-nothing callable. Stub for testing.
Nr   r   r   r   Únoopr      s   ‚ r   c                   ór   a € ] tR t^t o RtR.tV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 lt	Rt
V tR# )ÚCoreFoundationSpecificTestszF
Tests for platform interactions of the CoreFoundation-based reactor.
z$twisted.internet.cfreactor.CFReactorc                ó   <€ V ^8„  d   QhRR/# r   r   )r   Ú__classdict__s   "€r   r   Ú(CoreFoundationSpecificTests.__annotate__   s   ø€ ÷ 1ñ 1¨Tñ 1r   c                óä   € V P                  4       pVP                  ^ VP                  4       VP                  ^d\        4       V P	                  V4       V P                  VP                  R4       R# )z?
CFReactor's simulation timer is None after CFReactor crashes.
N)ÚbuildReactorÚ	callLaterÚcrashr   Ú
runReactorÚassertIsÚ_currentSimulator)ÚselfÚrs   & r   Útest_whiteboxStopSimulatingÚ7CoreFoundationSpecificTests.test_whiteboxStopSimulating   sR   € ð ×ÑÓˆØ	�‰�A�q—w‘wÔØ	�‰�CœÔØ�‰˜ÔØ�‰�a×)Ñ)¨4Ö0r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   &   s   ø€ ÷ 9ñ 9 tñ 9r   c                ó$  aa€ V P                  4       pVP                  ^ \        4      pV P                  4       oR VV3R llpR V3R lloSP                  ^ V4       V P                  S4       V P	                  VP                  4       V.4       R# )a,  
callLater should not leak global state into CoreFoundation which will
be invoked by a different reactor running the main loop.

@note: this test may actually be usable for other reactors as well, so
    we may wish to promote it to ensure this invariant across other
    foreign-main-loop reactors.
c                ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   ÚGCoreFoundationSpecificTests.test_callLaterLeakage.<locals>.__annotate__3   s   € ÷ 	$ñ 	$˜dñ 	$r   c                  ó,   <€ S P                  ^ S4       R# )r   N)r   )Úr2Úr2stops   €€r   ÚstopBlockingÚGCoreFoundationSpecificTests.test_callLaterLeakage.<locals>.stopBlocking3   s   ø€ Ø�L‰L˜˜FÖ#r   c                ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   r%   6   s   € ÷ 	ñ 	˜ñ 	r   c                  ó(   <€ S P                  4        R # ©N)Ústop)r'   s   €r   r(   ÚACoreFoundationSpecificTests.test_callLaterLeakage.<locals>.r2stop6   s   ø€ Ø�G‰GŽIr   N)r   r   r   r   ÚassertEqualÚgetDelayedCalls)r   r   Údelayedr)   r'   r(   s   &   @@r   Útest_callLaterLeakageÚ1CoreFoundationSpecificTests.test_callLaterLeakage&   s|   ù€ ð ×ÑÓˆØ—+‘+˜a¤Ó&ˆØ×ÑÓ ˆ÷	$ñ 	$÷	ð 	ð 	�‰�Q˜Ô%Ø�‰˜ÔØ×Ñ˜×*Ñ*Ó,¨w¨iÖ8r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   =   s   ø€ ÷ !ñ ! dñ !r   c                óP  € V P                  4       p. pVP                  ^ VP                  ^4       VP                  ^d\        4      pVP	                  4        V P                  VP                  R4       V P                  VP                  4       V.4       V P                  V^.4       R# )a>  
C{.iterate()} should remove the CFTimer that will run Twisted's
callLaters from the loop, even if one is still pending.  We test this
state indirectly with a white-box assertion by verifying the
C{_currentSimulator} is set to C{None}, since CoreFoundation does not
allow us to enumerate all active timers or sources.
N)	r   r   Úappendr   Úiterater   r   r0   r1   )r   r   Úxr2   s   &   r   Útest_whiteboxIterateÚ0CoreFoundationSpecificTests.test_whiteboxIterate=   s…   € ð ×ÑÓˆØˆØ	�‰�A�q—x‘x Ô#Ø—+‘+˜c¤4Ó(ˆØ	�	‰	ŒØ�‰�a×)Ñ)¨4Ô0Ø×Ñ˜×*Ñ*Ó,¨w¨iÔ8Ø×Ñ˜˜Q˜CÖ r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   N   s   ø€ ÷ +ñ +˜tñ +r   c                óØ   aaa€ V P                  4       o. oR VV3R lloR VV3R llpSP                  ^ SP                  V4       SP                  4        V P	                  SR.4       R# )zC
The loop can wake up just fine even if there are no timers in it.
c                ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   Ú?CoreFoundationSpecificTests.test_noTimers.<locals>.__annotate__U   s   € ÷ 	"ñ 	"˜ñ 	"r   c                  óJ   <€ S P                  4        SP                  R 4       R# )ÚyesN)r.   r7   )r   Ústoppeds   €€r   ÚdoStopÚ9CoreFoundationSpecificTests.test_noTimers.<locals>.doStopU   s   ø€ Ø�F‰FŒHØ�N‰N˜5Ö!r   c                ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   r?   Y   s   € ÷ 	%ñ 	%˜tñ 	%r   c                  ó*   <€ SP                  S 4       R # r-   )ÚcallFromThread)rC   r   s   €€r   ÚsleepThenStopÚ@CoreFoundationSpecificTests.test_noTimers.<locals>.sleepThenStopY   s   ø€ Ø×Ñ˜VÖ$r   rA   N)r   r   ÚcallInThreadÚrunr0   )r   rH   rC   r   rB   s   & @@@r   Útest_noTimersÚ)CoreFoundationSpecificTests.test_noTimersN   s_   ú€ ð ×ÑÓˆØˆ÷	"ñ 	"÷	%ñ 	%ð 	
�‰�A�q—~‘~ }Ô5ð
 	
�‰ŒØ×Ñ˜ 5 'Ö*r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	_reactorsr    r3   r:   rL   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s<   ø‡ € ñð 8Ð8€I÷1ð 1÷9ð 9÷.!ð !÷"+ö +r   r   N)Útypingr   r   Útwisted.trial.unittestr   Úreactormixinsr   ÚfakeBaseÚobjectr   r   ÚglobalsÚupdateÚmakeTestCaseClassesr   r   r   Ú<module>r^      sT   ðß &å 6Ý )çØ"�Hà€Hõñ „ôM+ .°(ô M+ñ` ƒ	× Ñ Ð,×@Ñ@ÓBÖ Cr   