+
    üÐjC  ã                   óL   € R t ^ RIHt ^ RIHt ^RIHtHtHt  ! R R]4      t	R# )z(
Tests for L{twisted._threads._memory}.
)ÚverifyObject)ÚSynchronousTestCase)ÚAlreadyQuitÚIWorkerÚcreateMemoryWorkerc                   óZ   a € ] tR t^t o R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	# )
ÚMemoryWorkerTestsz
Tests for L{MemoryWorker}.
c                ó   <€ V ^8„  d   QhRR/# ©é   ÚreturnN© )ÚformatÚ__classdict__s   "€ÚC/usr/lib/python3/dist-packages/twisted/_threads/test/test_memory.pyÚ__annotate__ÚMemoryWorkerTests.__annotate__   s   ø€ ÷ 'ñ '¨Tñ 'ó    c                óf  a€ \        4       w  r\        \        V4       . oVP                  V3R l4       VP                  V3R l4       V P	                  S. 4       V P	                  V! 4       R4       V P	                  S^.4       V P	                  V! 4       R4       V P	                  S^^.4       R# )z˜
L{createMemoryWorker} creates an L{IWorker} and a callable that can
perform work on it.  The performer returns C{True} if it accomplished
useful work.
c                  ó&   <€ S P                  ^4      # )é   ©Úappend©Údones   €r   Ú<lambda>Ú?MemoryWorkerTests.test_createWorkerAndPerform.<locals>.<lambda>   ó   ø€ ˜$Ÿ+™+ aœ.r   c                  ó&   <€ S P                  ^4      # )é   r   r   s   €r   r   r      r   r   TN)r   r   r   ÚdoÚassertEqual)ÚselfÚworkerÚ	performerr   s   &  @r   Útest_createWorkerAndPerformÚ-MemoryWorkerTests.test_createWorkerAndPerform   s“   ø€ ô /Ó0ÑˆÜ”W˜fÔ%ØˆØ�	‰	Ô(Ô)Ø�	‰	Ô(Ô)Ø×Ñ˜˜rÔ"Ø×Ñ™› dÔ+Ø×Ñ˜ ˜sÔ#Ø×Ñ™› dÔ+Ø×Ñ˜  1˜vÖ&r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r   $   s   ø€ ÷ -ñ - ñ -r   c                ó\  a€ \        4       w  r. oR V3R llpVP                  V4       VP                  4        V P                  \        VP                  V4       V P                  \        VP                  4       V! 4        V P                  S^.4       V P                  V! 4       R4       R# )zõ
Calling C{quit} on the worker returned by L{createMemoryWorker} causes
its C{do} and C{quit} methods to raise L{AlreadyQuit}; its C{perform}
callable will start raising L{AlreadyQuit} when the work already
provided to C{do} has been exhausted.
c                ó   € V ^8„  d   QhRR/# r
   r   )r   s   "r   r   Ú6MemoryWorkerTests.test_quitQuits.<locals>.__annotate__.   s   € ÷ 	ñ 	˜$ñ 	r   c                  ó*   <€ S P                  ^4       R# )é   Nr   r   s   €r   ÚmoreWorkÚ2MemoryWorkerTests.test_quitQuits.<locals>.moreWork.   s   ø€ Ø�K‰K˜ŽNr   FN)r   r    ÚquitÚassertRaisesr   r!   )r"   r#   r$   r-   r   s   &   @r   Útest_quitQuitsÚ MemoryWorkerTests.test_quitQuits$   s‰   ø€ ô /Ó0ÑˆØˆ÷	ð 	ð 	�	‰	�(ÔØ�‰ŒØ×Ñœ+ v§y¡y°(Ô;Ø×Ñœ+ v§{¡{Ô3ÙŒØ×Ñ˜ ˜sÔ#Ø×Ñ™› eÖ,r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r   9   s   ø€ ÷ -ñ -°ñ -r   c                óL   € \        4       w  rV P                  V! 4       R4       R# )z°
The C{perform} callable returned by L{createMemoryWorker} will return
no result when there's no work to do yet.  Since there is no work to
do, the performer returns C{False}.
FN)r   r!   )r"   r#   r$   s   &  r   Útest_performWhenNothingToDoYetÚ0MemoryWorkerTests.test_performWhenNothingToDoYet9   s!   € ô /Ó0ÑˆØ×Ñ™› eÖ,r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r%   r1   r5   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s(   ø‡ € ñ÷'ð '÷"-ð -÷*-ö -r   r   N)
r;   Úzope.interface.verifyr   Útwisted.trial.unittestr   Ú r   r   r   r   r   r   r   Ú<module>rA      s%   ðñõ /å 6ß 7Ñ 7ô2-Ð+ö 2-r   