§
    Ètºfk&  ã                  óÀ   — d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
  G d„ de
j        ¦  «        Z G d„ d	e
j        ¦  «        Z G d
„ de
j        ¦  «        ZdS )é    )ÚannotationsN)ÚSequence)Úerror)Úunittestc                  ó  — e Zd ZU dZg dej        g i f‘dej        dgi f‘dej        ddgi f‘dej        dd	 ej        d
¦  «        fi f‘dej        g i f‘dej        ddgi f‘dej	        g i f‘dej	        ddgi f‘dej
        g i f‘dej
        dgi f‘dej
        g ddif‘dej
        ddgi f‘dej        g i f‘dej        dgi f‘dej        ddgi f‘dej        g i f‘dej        g i f‘dej        g i f‘dej        g i f‘dej        g i f‘dej        g i f‘dej        g i f‘dej        g i f‘d ej        g i f‘d!ej        g i f‘d"ej        ddgi f‘d#ej        g i f‘d$ej        ddgi f‘d%ej        g i f‘d&ej        g i f‘d'ej        ddgi f‘d(ej        g i f‘d)ej        d*d+gi f‘d,ej        d-gi f‘d.ej        g i f‘d/ej        g d0d1if‘d2ej        g d3d4if‘d5ej        g i f‘d6ej        d*d7gi f‘d8ej        g i f‘d9ej        d:d;gi f‘Zd<ed=<   dBd@„Z dBdA„Z!d-S )CÚ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’  ÚFoozMessage is too long to send.z%Message is too long to send: foo bar.zDNS lookup failed.zDNS 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.zCouldn't bind.zCouldn't bind: someOsError.z Couldn't bind: someOsError: foo.zHostname couldn't be looked up.zNo route to host.z%Connection was refused by other side.zTCP connection timed out.z%File used for UNIX socket is no good.z&Service name given as port is unknown.zUser aborted connection.z'User timeout caused connection failure.zAn 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.zConnection was closed cleanly.z'Connection was closed cleanly: foo bar.zUh.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]]]ÚlistOfTestsÚreturnÚNonec           
     ó¬   — | j         D ]K}|d         }|d         }|d         }|d         }|                      t           ||i |¤Ž¦  «        |¦  «         ŒLd S )Nr   é   é   é   )r   ÚassertEqualÚstr)ÚselfÚentryÚoutputÚ	exceptionÚargsÚkwargss         úV/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/test/test_error.pyÚtestThemAllz StringificationTests.testThemAll¸   sv   € ØÔ%ð 	Fð 	FˆEØ˜1”XˆFØ˜aœˆIØ˜”8ˆDØ˜1”XˆFà×Ò�S  ¨DÐ!;°FÐ!;Ð!;Ñ<Ô<¸fÑEÔEÐEÐEð	Fð 	Fó    c                ó€   — t          ¦   «         }t          j        |¦  «        }|                      |j        |¦  «         dS )zP
        L{error.ConnectingCancelledError} has an C{address} attribute.
        N)Úobjectr   ÚConnectingCancelledErrorÚassertIsÚaddress)r!   r.   Úes      r'   Útest_connectingCancelledErrorz2StringificationTests.test_connectingCancelledErrorÁ   s9   € õ ‘(”(ˆÝÔ*¨7Ñ3Ô3ˆØ�Š�a”i Ñ)Ô)Ð)Ð)Ð)r)   ©r   r   )"Ú__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(   r0   © r)   r'   r   r      s0  € € € € € € Ø@Ð@ð^	à	5°u´ÈÈBÐOð^	ð >ØŒOØˆGØð		
ð^	ð BØŒOØ�EˆNØð		
ð^	ð  1ØÔ#Ø�T˜<˜6œ<¨Ñ.Ô.Ð/Øð		
ð^	ð* 
(¨Ô)AÀ2ÀrÐJð+^	ð. 4ØÔ$Ø�EˆNØð		
ð-^	ð8 
˜uÔ3°R¸Ð<ð9^	ð: 
'¨Ô(<¸uÀe¸nÈbÐQð;^	ð< 
/°Ô0BÀBÈÐKð=^	ð@ ?ØÔØˆOØð		
ð?^	ðL 7ØÔØØ�uÐð		
ðK^	ðX DØÔØ˜EÐ"Øð		
ðW^	ðb 
˜5Ô1°2°rÐ:ðc^	ðd 
'¨Ô(>ÀÀÐQSÐTðe^	ðh /ØÔ"Ø˜EÐ"Øð		
ðg^	ðr 
+¨EÔ,BÀBÈÐKðs^	ðt 
˜eÔ0°"°bÐ9ðu^	ðv 
1°%Ô2NÐPRÐTVÐWðw^	ðx 
% eÔ&<¸bÀ"ÐEðy^	ðz 
1°%Ô2DÀbÈ"ÐMð{^	ð~ 5ØÔ)ØØð		
ð}^	ðH 
$ U¤_°b¸"Ð=ðI^	ðJ 
3°EÔ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È"ÈbÐQðA^	ðD @ØÔØ�EˆNØð		
ðC^	ðN 
7¸Ô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ð eð eñ eðNFð Fð Fð Fð*ð *ð *ð *ð *ð *r)   r   c                  ó*   — e Zd ZdZdd„Zdd„Zdd„ZdS )	ÚSubclassingTestsz=
    Some exceptions are subclasses of other exceptions.
    r   r   c                ót   — |                       t          t          j        t          j        ¦  «        ¦  «         dS )zW
        L{error.ConnectionClosed} is a superclass of L{error.ConnectionLost}.
        N)Ú
assertTrueÚ
issubclassr   rF   ÚConnectionClosed©r!   s    r'   Ú-test_connectionLostSubclassOfConnectionClosedz>SubclassingTests.test_connectionLostSubclassOfConnectionClosedÏ   ó,   € ð 	�Š�
¥5Ô#7½Ô9OÑPÔPÑQÔQÐQÐQÐQr)   c                ót   — |                       t          t          j        t          j        ¦  «        ¦  «         dS )zW
        L{error.ConnectionClosed} is a superclass of L{error.ConnectionDone}.
        N)rT   rU   r   rG   rV   rW   s    r'   Ú-test_connectionDoneSubclassOfConnectionClosedz>SubclassingTests.test_connectionDoneSubclassOfConnectionClosedÕ   rY   r)   c                ój   — |                       t          t          j        t          ¦  «        ¦  «         dS )zP
        L{ValueError} is a superclass of L{error.InvalidAddressError}.
        N)rT   rU   r   ÚInvalidAddressErrorÚ
ValueErrorrW   s    r'   Ú,test_invalidAddressErrorSubclassOfValueErrorz=SubclassingTests.test_invalidAddressErrorSubclassOfValueErrorÛ   s)   € ð 	�Š�
¥5Ô#<½jÑIÔIÑJÔJÐJÐJÐJr)   Nr1   )r2   r3   r4   r5   rX   r[   r_   rP   r)   r'   rR   rR   Ê   sh   € € € € € ðð ðRð Rð Rð RðRð Rð Rð RðKð Kð Kð Kð Kð Kr)   rR   c                  ó:   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚGetConnectErrorTestsz¢
    Given an exception instance thrown by C{socket.connect},
    L{error.getConnectError} returns the appropriate high-level Twisted
    exception instance.
    ÚerrnoÚintÚexpectedClassútype[error.ConnectError]r   r   c                óf   — |df}t          j        |¦  «        }|                      |d||¦  «         dS )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!   rb   rd   r/   Úresults        r'   ÚassertErrnoExceptionz)GetConnectErrorTests.assertErrnoExceptioné   s>   € ð �HÐˆÝÔ& qÑ)Ô)ˆØ×#Ò# E¨8°V¸]ÑKÔKÐKÐKÐKr)   ú
int | NoneÚmessager+   rj   úerror.ConnectErrorc                óª   — |                       |j        |¦  «         |                       |j        |¦  «         |                       |j        |f¦  «         dS )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%   )r!   rb   rm   rj   rd   s        r'   ri   z+GetConnectErrorTests.assertCorrectExceptionõ   sU   € ð 	×Ò˜Ô)¨=Ñ9Ô9Ð9Ø×Ò˜œ¨Ñ/Ô/Ð/Ø×Ò˜œ w jÑ1Ô1Ð1Ð1Ð1r)   c                óÎ  — |                       t          j        t          j        ¦  «         |                       t          j        t          j        ¦  «         |                       t          j        t          j        ¦  «         t          j
        dk    rV|                       t          j        t          j        ¦  «         |                       t          j        t          j        ¦  «         dS dS )zW
        L{error.getConnectError} converts based on errno for C{socket.error}.
        Úwin32N)rk   rb   ÚENETUNREACHr   r>   ÚECONNREFUSEDr?   Ú	ETIMEDOUTr@   ÚsysÚplatformÚWSAECONNREFUSEDÚWSAENETUNREACHrW   s    r'   Ú
test_errnozGetConnectErrorTests.test_errno  s³   € ð 	×!Ò!¥%Ô"3µUÔ5GÑHÔHÐHØ×!Ò!¥%Ô"4µeÔ6RÑSÔSÐSØ×!Ò!¥%¤/µ5Ô3IÑJÔJÐJÝŒ<˜7Ò"Ð"Ø×%Ò%ÝÔ%¥uÔ'Cñô ð ð ×%Ò%¥eÔ&:½EÔ<NÑOÔOÐOÐOÐOð	 #Ð"r)   c                ó˜   — t          j        t          j        dd¦  «        ¦  «        }|                      dd|t           j        ¦  «         dS )z
        L{error.getConnectError} converts to a L{error.UnknownHostError} given
        a C{socket.gaierror} instance.
        é   ÚhelloN)r   rh   r8   Úgaierrorri   r=   )r!   rj   s     r'   Útest_gaierrorz"GetConnectErrorTests.test_gaierror  sC   € õ
 Ô&¥v¤°r¸7Ñ'CÔ'CÑDÔDˆØ×#Ò# B¨°½Ô9OÑPÔPÐPÐPÐPr)   c                óŽ   — t          ¦   «         }t          j        |¦  «        }|                      d||t          j        ¦  «         dS )z�
        L{error.getConnectError} converts to a L{error.ConnectError} given
        an argument that cannot be unpacked.
        N)Ú	Exceptionr   rh   ri   r;   )r!   r/   rj   s      r'   Útest_nonTuplez"GetConnectErrorTests.test_nonTuple  s@   € õ
 ‰KŒKˆÝÔ& qÑ)Ô)ˆØ×#Ò# D¨!¨VµUÔ5GÑHÔHÐHÐHÐHr)   N)rb   rc   rd   re   r   r   )
rb   rl   rm   r+   rj   rn   rd   re   r   r   r1   )	r2   r3   r4   r5   rk   ri   r{   r€   rƒ   rP   r)   r'   ra   ra   â   s”   € € € € € ðð ð
Lð 
Lð 
Lð 
Lð2ð 2ð 2ð 2ð"Pð Pð Pð PðQð Qð Qð QðIð Ið Ið Ið Ið Ir)   ra   )Ú
__future__r   rb   r8   rw   Útypingr   Útwisted.internetr   Útwisted.trialr   ÚSynchronousTestCaser   rR   ra   rP   r)   r'   ú<module>r‰      s   ðð #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø 
€
€
€
Ø Ð Ð Ð Ð Ð à "Ð "Ð "Ð "Ð "Ð "Ø "Ð "Ð "Ð "Ð "Ð "ðy*ð y*ð y*ð y*ð y*˜8Ô7ñ y*ô y*ð y*ðxKð Kð Kð Kð K�xÔ3ñ Kô Kð Kð0@Ið @Ið @Ið @Ið @I˜8Ô7ñ @Iô @Ið @Ið @Ið @Ir)   