%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_error.cpython-312.pyc

�

Ϫ�fk&����ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
Gd�de
j�ZGd�d	e
j�Z
Gd
�de
j�Zy)�)�annotationsN)�Sequence)�error)�unittestc��eZdZUdZgdej
gif�dej
dgif�dej
ddgif�dejdd	ejd
�fif�dejgif�dejddgif�d
ejgif�dejddgif�dejgif�dejdgif�dejgddif�dejddgif�dejgif�dejdgif�dejddgif�dejgif�dejgif�dejgif�dejgif�dej gif�dej"gif�dej$gif�dej&gif�d ej(gif�d!ej*gif�d"ej*ddgif�d#ej,gif�d$ej,ddgif�d%ej.gif�d&ej0gif�d'ej0ddgif�d(ej2gif�d)ej2d*d+gif�d,ej4d-gif�d.ej6gif�d/ej6gd0d1if�d2ej6gd3d4if�d5ej8gif�d6ej8d*d7gif�d8ej:gif�d9ej:d:d;gif�Zd<ed=<d@d>�Z d@d?�Z!y-)A�StringificationTestsz6Test that the exceptions have useful stringifications.z*An error occurred binding to an interface.z/An error occurred binding to an interface: foo.�fooz3An error occurred binding to an interface: foo bar.�barz"Couldn't listen on eth0:4242: Foo.�eth0i��FoozMessage is too long to send.z%Message is too long to send: foo bar.zDNS lookup failed.zDNS lookup failed: foo bar.z#An error occurred while connecting.z0An error occurred while connecting: someOsError.�someOsErrorz(An error occurred while connecting: foo.�stringz5An error occurred while connecting: someOsError: foo.zCouldn't bind.zCouldn't bind: someOsError.z Couldn't bind: someOsError: foo.zHostname couldn't be looked up.zNo route to host.z%Connection was refused by other side.zTCP connection timed out.z%File used for UNIX socket is no good.z&Service name given as port is unknown.zUser aborted connection.z'User timeout caused connection failure.zAn SSL error occurred.z=Connection to the other side was lost in a non-clean fashion.zFConnection to the other side was lost in a non-clean fashion: foo bar.zConnection was closed cleanly.z'Connection was closed cleanly: foo bar.zUh.z(Tried to cancel an already-called event.z1Tried to cancel an already-called event: foo bar.z+Tried to cancel an already-cancelled event.z0Tried to cancel an already-cancelled event: x 2.�x�2zOA process has ended without apparent errors: process finished with exit code 0.NzCA process has ended with a probable error condition: process ended.zUA process has ended with a probable error condition: process ended with exit code 42.�exitCode�*zTA process has ended with a probable error condition: process ended by signal SIGBUS.�signal�SIGBUSzFThe Connector was not connecting when it was asked to stop connecting.zLThe Connector was not connecting when it was asked to stop connecting: x 13.�13z?The Port was not listening when it was asked to stop listening.zEThe Port was not listening when it was asked to stop listening: a 12.�a�12z_list[tuple[str, type[Exception], Sequence[str | int | Exception | None], dict[str, str | int]]]�listOfTestsc
��|jD]7}|d}|d}|d}|d}|jt||i|���|��9y)Nr���)r�assertEqual�str)�self�entry�output�	exception�args�kwargss      �9/usr/lib/python3/dist-packages/twisted/test/test_error.py�testThemAllz StringificationTests.testThemAll�s\���%�%�	F�E��1�X�F��a��I���8�D��1�X�F����S��D�!;�F�!;�<�f�E�
	F�c�z�t�}tj|�}|j|j|�y)zP
        L{error.ConnectingCancelledError} has an C{address} attribute.
        N)�objectr�ConnectingCancelledError�assertIs�address)rr,�es   r%�test_connectingCancelledErrorz2StringificationTests.test_connectingCancelledError�s-���(���*�*�7�3���
�
�a�i�i��)r'��return�None)"�__name__�
__module__�__qualname__�__doc__r�	BindError�CannotListenError�socket�MessageLengthError�DNSLookupError�ConnectError�ConnectBindError�UnknownHostError�NoRouteError�ConnectionRefusedError�TCPTimedOutError�BadFileError�ServiceNameUnknownError�	UserError�TimeoutError�SSLError�ConnectionLost�ConnectionDone�ConnectionFdescWentAway�
AlreadyCalled�AlreadyCancelled�ProcessDone�ProcessTerminated�NotConnectingError�NotListeningErrorr�__annotations__r&r.�r'r%rrs`��@�^	�	5�u����B�O�^	�
>��O�O�
�G��		
�^	�
B��O�O�
�E�N��		
�^	� 
1��#�#�
�T�<�6�<�<��.�/��		
�^	�*
(��)A�)A�2�r�J�+^	�.
4��$�$�
�E�N��		
�-^	�8
�u�3�3�R��<�9^	�:
'��(<�(<�u�e�n�b�Q�;^	�<
/��0B�0B�B��K�=^	�@
?����
�O��		
�?^	�L
7�����
�u��		
�K^	�X
D����
�E�"��		
�W^	�b
�5�1�1�2�r�:�c^	�d
'��(>�(>���QS�T�e^	�h
/��"�"�
�E�"��		
�g^	�r
+�E�,B�,B�B��K�s^	�t
�e�0�0�"�b�9�u^	�v
1�%�2N�2N�PR�TV�W�w^	�x
%�e�&<�&<�b�"�E�y^	�z
1�%�2D�2D�b�"�M�{^	�~
5��)�)���		
�}^	�H
$�U�_�_�b�"�=�I^	�J
3�E�4F�4F��B�O�K^	�L
"�5�>�>�2�r�:�M^	�P
L�� � ���		
�O^	�\
U�� � �
�E�N��		
�[^	�f
*�5�+?�+?��R�H�g^	�j
6�� � �
�E�N��		
�i^	�v
��)�)���		
�u^	�@
4�U�5H�5H�"�b�Q�A^	�D
@����
�E�N��		
�C^	�N
7��8N�8N�PR�TV�W�O^	�R
?��"�"�
�#�J��		
�Q^	�^
^����
�F��		
�]^	�j
R��#�#���		
�i^	�v
d��#�#��
���		
�u^	�B
c��#�#��
�x� �		
�A^	�N
U��$�$���		
�M^	�Z
[��$�$�
�$�K��		
�Y^	�f
N��#�#���		
�e^	�r
T��#�#�
�$�K��		
�q^	���e�NF�*r'rc�(�eZdZdZdd�Zdd�Zdd�Zy)�SubclassingTestsz=
    Some exceptions are subclasses of other exceptions.
    c�r�|jttjtj��y)zW
        L{error.ConnectionClosed} is a superclass of L{error.ConnectionLost}.
        N)�
assertTrue�
issubclassrrF�ConnectionClosed�rs r%�-test_connectionLostSubclassOfConnectionClosedz>SubclassingTests.test_connectionLostSubclassOfConnectionClosed��#��	
���
�5�#7�#7��9O�9O�P�Qr'c�r�|jttjtj��y)zW
        L{error.ConnectionClosed} is a superclass of L{error.ConnectionDone}.
        N)rTrUrrGrVrWs r%�-test_connectionDoneSubclassOfConnectionClosedz>SubclassingTests.test_connectionDoneSubclassOfConnectionClosed�rYr'c�^�|jttjt��y)zP
        L{ValueError} is a superclass of L{error.InvalidAddressError}.
        N)rTrUr�InvalidAddressError�
ValueErrorrWs r%�,test_invalidAddressErrorSubclassOfValueErrorz=SubclassingTests.test_invalidAddressErrorSubclassOfValueError�s��	
���
�5�#<�#<�j�I�Jr'Nr/)r2r3r4r5rXr[r_rPr'r%rRrR�s���R�R�Kr'rRc�X�eZdZdZ						dd�Z										d	d�Zd
d�Zd
d�Zd
d�Zy)�GetConnectErrorTestsz�
    Given an exception instance thrown by C{socket.connect},
    L{error.getConnectError} returns the appropriate high-level Twisted
    exception instance.
    c�^�|df}tj|�}|j|d||�y)z�
        When called with a tuple with the given errno,
        L{error.getConnectError} returns an exception which is an instance of
        the expected class.
        �lalalaN)r�getConnectError�assertCorrectException)r�errno�
expectedClassr-�results     r%�assertErrnoExceptionz)GetConnectErrorTests.assertErrnoException�s2���H����&�&�q�)���#�#�E�8�V�]�Kr'c��|j|j|�|j|j|�|j|j|f�y)z�
        The given result of L{error.getConnectError} has the given attributes
        (C{osError} and C{args}), and is an instance of the given class.
        N)r�	__class__�osErrorr#)rrf�messagerhrgs     r%rez+GetConnectErrorTests.assertCorrectException�sD��	
����)�)�=�9��������/�������w�j�1r'c��|jtjtj�|jtj
tj�|jtjtj�tjdk(r]|jtjtj�|jtjtj�yy)zW
        L{error.getConnectError} converts based on errno for C{socket.error}.
        �win32N)
rirf�ENETUNREACHrr>�ECONNREFUSEDr?�	ETIMEDOUTr@�sys�platform�WSAECONNREFUSED�WSAENETUNREACHrWs r%�
test_errnozGetConnectErrorTests.test_errnos���	
�!�!�%�"3�"3�U�5G�5G�H��!�!�%�"4�"4�e�6R�6R�S��!�!�%�/�/�5�3I�3I�J��<�<�7�"��%�%��%�%�u�'C�'C�
�
�%�%�e�&:�&:�E�<N�<N�O�	#r'c��tjtjdd��}|j	dd|tj
�y)z
        L{error.getConnectError} converts to a L{error.UnknownHostError} given
        a C{socket.gaierror} instance.
        ��helloN)rrdr8�gaierrorrer=)rrhs  r%�
test_gaierrorz"GetConnectErrorTests.test_gaierrors9��
�&�&�v���r�7�'C�D���#�#�B����9O�9O�Pr'c��t�}tj|�}|jd||tj�y)z�
        L{error.getConnectError} converts to a L{error.ConnectError} given
        an argument that cannot be unpacked.
        N)�	Exceptionrrdrer;)rr-rhs   r%�
test_nonTuplez"GetConnectErrorTests.test_nonTuples5��

�K���&�&�q�)���#�#�D�!�V�U�5G�5G�Hr'N)rf�intrg�type[error.ConnectError]r0r1)
rfz
int | Nonermr)rhzerror.ConnectErrorrgr�r0r1r/)	r2r3r4r5rirerwr|rrPr'r%rara�so���
L��
L�)A�
L�	
�
L�2��2��2�#�	2�
0�2�
�
2�"P�Q�Ir'ra)�
__future__rrfr8rs�typingr�twisted.internetr�
twisted.trialr�SynchronousTestCaserrRrarPr'r%�<module>r�s[��#��
�
��"�"�y*�8�7�7�y*�xK�x�3�3�K�0@I�8�7�7�@Ir'

Zerion Mini Shell 1.0