ó
    ×›‘hk&  ã                  óÊ   • S SK Jr  S SKrS SKrS SKrS SKJr  S SKJr  S SK	J
r
   " S S\
R                  5      r " S S	\
R                  5      r " S
 S\
R                  5      rg)é    )ÚannotationsN)ÚSequence)Úerror)Úunittestc                  óÂ  • \ rS rSr% Sr/ S\R                  / 0 4PS\R                  S/0 4PS\R                  SS/0 4PS\R                  S	S
\R
                  " S5      40 4PS\R                  / 0 4PS\R                  SS/0 4PS\R                  / 0 4PS\R                  SS/0 4PS\R                  / 0 4PS\R                  S/0 4PS\R                  / SS04PS\R                  SS/0 4PS\R                  / 0 4PS\R                  S/0 4PS\R                  SS/0 4PS\R                  / 0 4PS\R                  / 0 4PS\R                  / 0 4PS\R                   / 0 4PS\R"                  / 0 4PS\R$                  / 0 4PS\R&                  / 0 4PS \R(                  / 0 4PS!\R*                  / 0 4PS"\R,                  / 0 4PS#\R,                  SS/0 4PS$\R.                  / 0 4PS%\R.                  SS/0 4PS&\R0                  / 0 4PS'\R2                  / 0 4PS(\R2                  SS/0 4PS)\R4                  / 0 4PS*\R4                  S+S,/0 4PS-\R6                  S./0 4PS/\R8                  / 0 4PS0\R8                  / S1S204PS3\R8                  / S4S504PS6\R:                  / 0 4PS7\R:                  S+S8/0 4PS9\R<                  / 0 4PS:\R<                  S;S</0 4PrS=\ S>'   SBS? jr!SBS@ jr"SAr#g.)CÚStringificationTestsé   z6Test 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]]]ÚlistOfTestsc           
     ó”   • U R                    H8  nUS   nUS   nUS   nUS   nU R                  [        U" U0 UD65      U5        M:     g )Nr   é   é   é   )r   ÚassertEqualÚstr)ÚselfÚentryÚoutputÚ	exceptionÚargsÚkwargss         Ú[C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/test/test_error.pyÚtestThemAllÚ StringificationTests.testThemAll¸   sU   € Ø×%Ô%ˆEØ˜1‘XˆFØ˜a™ˆIØ˜‘8ˆDØ˜1‘XˆFà×ÑœS¡¨DÐ!;°FÑ!;Ó<¸fÖEò &ó    c                ó|   • [        5       n[        R                  " U5      nU R                  UR                  U5        g)z@
L{error.ConnectingCancelledError} has an C{address} attribute.
N)Úobjectr   ÚConnectingCancelledErrorÚassertIsÚaddress)r    r.   Úes      r&   Útest_connectingCancelledErrorÚ2StringificationTests.test_connectingCancelledErrorÁ   s-   € ô “(ˆÜ×*Ò*¨7Ó3ˆØ�‰�a—i‘i Õ)r)   © ©ÚreturnÚNone)$Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__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   Ú__static_attributes__r2   r)   r&   r   r      s^  ‡ Ù@ð^	à	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ôNF÷*r)   r   c                  ó6   • \ rS rSrSrSS jrSS jrSS jrSrg)	ÚSubclassingTestséÊ   z5
Some exceptions are subclasses of other exceptions.
c                ór   • U R                  [        [        R                  [        R                  5      5        g)zG
L{error.ConnectionClosed} is a superclass of L{error.ConnectionLost}.
N)Ú
assertTrueÚ
issubclassr   rK   ÚConnectionClosed©r    s    r&   Ú-test_connectionLostSubclassOfConnectionClosedÚ>SubclassingTests.test_connectionLostSubclassOfConnectionClosedÏ   ó#   € ð 	�‰œ
¤5×#7Ñ#7¼×9OÑ9OÓPÕQr)   c                ór   • U R                  [        [        R                  [        R                  5      5        g)zG
L{error.ConnectionClosed} is a superclass of L{error.ConnectionDone}.
N)rZ   r[   r   rL   r\   r]   s    r&   Ú-test_connectionDoneSubclassOfConnectionClosedÚ>SubclassingTests.test_connectionDoneSubclassOfConnectionClosedÕ   r`   r)   c                ó^   • U R                  [        [        R                  [        5      5        g)z@
L{ValueError} is a superclass of L{error.InvalidAddressError}.
N)rZ   r[   r   ÚInvalidAddressErrorÚ
ValueErrorr]   s    r&   Ú,test_invalidAddressErrorSubclassOfValueErrorÚ=SubclassingTests.test_invalidAddressErrorSubclassOfValueErrorÛ   s   € ð 	�‰œ
¤5×#<Ñ#<¼jÓIÕJr)   r2   Nr3   )	r6   r7   r8   r9   r:   r^   rb   rg   rU   r2   r)   r&   rW   rW   Ê   s   † ñôRôR÷Kr)   rW   c                  ój   • \ rS rSrSr      S
S jr          SS jrSS jrSS jrSS jr	Sr
g	)ÚGetConnectErrorTestséâ   z’
Given an exception instance thrown by C{socket.connect},
L{error.getConnectError} returns the appropriate high-level Twisted
exception instance.
c                ó^   • US4n[         R                  " U5      nU R                  USXB5        g)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&   ÚassertErrnoExceptionÚ)GetConnectErrorTests.assertErrnoExceptioné   s0   € ð �HÐˆÜ×&Ò& qÓ)ˆØ×#Ñ# E¨8°VÕKr)   c                ó®   • U R                  UR                  U5        U R                  UR                  U5        U R                  UR                  U45        g)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    rp   Úmessagerr   rq   s        r&   ro   Ú+GetConnectErrorTests.assertCorrectExceptionõ   sD   € ð 	×Ñ˜×)Ñ)¨=Ô9Ø×Ñ˜Ÿ™¨Ô/Ø×Ñ˜Ÿ™ w jÕ1r)   c                óú  • U R                  [        R                  [        R                  5        U R                  [        R
                  [        R                  5        U R                  [        R                  [        R                  5        [        R                  S:X  a]  U R                  [        R                  [        R                  5        U R                  [        R                  [        R                  5        gg)zG
L{error.getConnectError} converts based on errno for C{socket.error}.
Úwin32N)rs   rp   ÚENETUNREACHr   rC   ÚECONNREFUSEDrD   Ú	ETIMEDOUTrE   ÚsysÚplatformÚWSAECONNREFUSEDÚWSAENETUNREACHr]   s    r&   Ú
test_errnoÚGetConnectErrorTests.test_errno  s¤   € ð 	×!Ñ!¤%×"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                óž   • [         R                  " [        R                  " SS5      5      nU R	                  SSU[         R
                  5        g)zg
L{error.getConnectError} converts to a L{error.UnknownHostError} given
a C{socket.gaierror} instance.
é   ÚhelloN)r   rn   r=   Úgaierrorro   rB   )r    rr   s     r&   Útest_gaierrorÚ"GetConnectErrorTests.test_gaierror  s9   € ô
 ×&Ò&¤v§¢°r¸7Ó'CÓDˆØ×#Ñ# B¨°¼×9OÑ9OÕPr)   c                ó†   • [        5       n[        R                  " U5      nU R                  SX[        R                  5        g)zi
L{error.getConnectError} converts to a L{error.ConnectError} given
an argument that cannot be unpacked.
N)Ú	Exceptionr   rn   ro   r@   )r    r/   rr   s      r&   Útest_nonTupleÚ"GetConnectErrorTests.test_nonTuple  s3   € ô
 ‹KˆÜ×&Ò& qÓ)ˆØ×#Ñ# D¨!´U×5GÑ5GÕHr)   r2   N)rp   Úintrq   útype[error.ConnectError]r4   r5   )
rp   z
int | Nonerx   r+   rr   zerror.ConnectErrorrq   r�   r4   r5   r3   )r6   r7   r8   r9   r:   rs   ro   rƒ   r‰   r�   rU   r2   r)   r&   rj   rj   â   so   † ñð
LØð
LØ)Að
Là	ô
Lð2àð2ð ð2ð #ð	2ð
 0ð2ð 
ô2ô"PôQ÷Ir)   rj   )Ú
__future__r   rp   r=   r   Útypingr   Útwisted.internetr   Útwisted.trialr   ÚSynchronousTestCaser   rW   rj   r2   r)   r&   Ú<module>r–      s[   ðõ #ã Û Û 
Ý å "Ý "ôy*˜8×7Ñ7ô y*ôxK�x×3Ñ3ô Kô0@I˜8×7Ñ7õ @Ir)   