Ë
    oj
  ã                   óF   — d Z ddlmZ ddlmZmZ ddlmZ  G d„ de«      Zy)zš
Tests for L{twisted.internet._baseprocess} which implements process-related
functionality that is useful in all platforms supporting L{IReactorProcess}.
é    )ÚBaseProcess)ÚgetWarningMethodÚsetWarningMethod)ÚTestCasec                   ó   — e Zd ZdZd„ Zd„ Zy)ÚBaseProcessTestsz·
    Tests for L{BaseProcess}, a parent class for other classes which represent
    processes which implements functionality common to many different process
    implementations.
    c                 ó"  —  G d„ d«      }t        d«      }t         |«       «      }|j                  |«       |j                  j                  j                  t         «       | j                  ||j                  j                  j                  «       y)z¸
        L{BaseProcess._callProcessExited} calls the C{processExited} method of
        its C{proto} attribute and passes it a L{Failure} wrapping the given
        exception.
        c                   ó   — e Zd ZdZd„ Zy)ú:BaseProcessTests.test_callProcessExited.<locals>.FakeProtoNc                 ó   — || _         y ©N)Úreason)Úselfr   s     úH/usr/lib/python3/dist-packages/twisted/internet/test/test_baseprocess.pyÚprocessExitedzHBaseProcessTests.test_callProcessExited.<locals>.FakeProto.processExited   s	   € Ø$�•ó    )Ú__name__Ú
__module__Ú__qualname__r   r   © r   r   Ú	FakeProtor      s   „ ØˆFó%r   r   zfake reasonN)ÚRuntimeErrorr   Ú_callProcessExitedÚprotor   ÚtrapÚassertIsÚvalue)r   r   r   Úprocesss       r   Útest_callProcessExitedz'BaseProcessTests.test_callProcessExited   sh   € ÷	%ñ 	%ô ˜mÓ,ˆÜ™i›kÓ*ˆØ×"Ñ" 6Ô*Ø�‰×Ñ×!Ñ!¤,Ô/Ø�‰�f˜gŸm™m×2Ñ2×8Ñ8Õ9r   c                 óŠ  ‡—  G d„ d«      }t        «       }t         |«       «      }| j                  t        t	        «       «       g Šˆfd„}t        |«       |j                  |«       ‰\  \  }}}| j                  |d|j                  ›d|j                  ›d�«       | j                  |t        «       | j                  |d«       y)	zµ
        L{BaseProcess._callProcessExited} emits a L{DeprecationWarning} if the
        object referred to by its C{proto} attribute has no C{processExited}
        method.
        c                   ó   — e Zd Zy)úABaseProcessTests.test_callProcessExitedMissing.<locals>.FakeProtoN)r   r   r   r   r   r   r   r"   /   s   „ Ør   r   c                 ó.   •— ‰j                  | ||f«       y r   )Úappend)ÚmessageÚcategoryÚ
stacklevelÚwarningss      €r   Úcollectz?BaseProcessTests.test_callProcessExitedMissing.<locals>.collect8   s   ø€ Ø�O‰O˜W h°
Ð;Õ<r   z@Since Twisted 8.2, IProcessProtocol.processExited is required.  ú.z must implement it.r   N)Úobjectr   Ú
addCleanupr   r   r   ÚassertEqualr   r   r   ÚDeprecationWarning)	r   r   r   r   r)   r%   r&   r'   r(   s	           @r   Útest_callProcessExitedMissingz.BaseProcessTests.test_callProcessExitedMissing(   s±   ø€ ÷	ñ 	ô “ˆÜ™i›kÓ*ˆà�‰Ô(Ô*:Ó*<Ô=Øˆô	=ô 	˜Ô!à×"Ñ" 6Ô*à,4Ñ)Ñ	(ˆ'�8˜ZØ×ÑÙà*3×*>Ó*>À	×@RÓ@RðTô	
ð
 	�‰�hÔ 2Ô3ð 	×Ñ˜ QÕ'r   N)r   r   r   Ú__doc__r   r/   r   r   r   r   r      s   „ ñò:ó&#(r   r   N)	r0   Útwisted.internet._baseprocessr   Útwisted.python.deprecater   r   Útwisted.trial.unittestr   r   r   r   r   ú<module>r4      s!   ðñõ
 6ß GÝ +ô=(�xõ =(r   