HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/internet/test/__pycache__/test_baseprocess.cpython-38.pyc
U


W[5
�@sDdZeZddlmZmZddlmZddlm	Z	Gdd�de�Z
dS)z�
Tests for L{twisted.internet._baseprocess} which implements process-related
functionality that is useful in all platforms supporting L{IReactorProcess}.
�)�getWarningMethod�setWarningMethod)�TestCase)�BaseProcessc@s eZdZdZdd�Zdd�ZdS)�BaseProcessTestsz�
    Tests for L{BaseProcess}, a parent class for other classes which represent
    processes which implements functionality common to many different process
    implementations.
    cCsNGdd�d�}td�}t|��}|�|�|jj�t�|�||jjj�dS)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@seZdZdZdd�ZdS)z:BaseProcessTests.test_callProcessExited.<locals>.FakeProtoNcSs
||_dS�N)�reason)�selfr�r
�H/usr/lib/python3/dist-packages/twisted/internet/test/test_baseprocess.py�
processExitedszHBaseProcessTests.test_callProcessExited.<locals>.FakeProto.processExited)�__name__�
__module__�__qualname__rrr
r
r
r�	FakeProtosrzfake reasonN)�RuntimeErrorr�_callProcessExited�protorZtrap�assertIs�value)r	rr�processr
r
r�test_callProcessExiteds

z'BaseProcessTests.test_callProcessExitedcs�Gdd�d�}t�}t|��}|�tt��g��fdd�}t|�|�|��\\}}}|�|d|j|jf�|�	|t
�|�|d�dS)z�
        L{BaseProcess._callProcessExited} emits a L{DeprecationWarning} if the
        object referred to by its C{proto} attribute has no C{processExited}
        method.
        c@seZdZdS)zABaseProcessTests.test_callProcessExitedMissing.<locals>.FakeProtoN)r
rrr
r
r
rr/srcs��|||f�dSr)�append)�message�category�
stacklevel��warningsr
r�collect7sz?BaseProcessTests.test_callProcessExitedMissing.<locals>.collectzXSince Twisted 8.2, IProcessProtocol.processExited is required.  %s.%s must implement it.rN)�objectrZ
addCleanuprrrZassertEqualrr
r�DeprecationWarning)r	rrrrrrrr
rr�test_callProcessExitedMissing)s&

���z.BaseProcessTests.test_callProcessExitedMissingN)r
rr�__doc__rr!r
r
r
rrsrN)r"�typeZ
__metaclass__Ztwisted.python.deprecaterrZtwisted.trial.unittestrZtwisted.internet._baseprocessrrr
r
r
r�<module>s