+
    Dfjk&                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
  ! R R]
P                  4      t ! R R	]
P                  4      t ! R
 R]
P                  4      tR# )    )annotationsN)Sequence)error)unittestc                     ] tR t^t$ Rt. R]P                  . / 3NR]P                  R./ 3NR]P                  RR./ 3NR]P                  RR	]P
                  ! R
4      3/ 3NR]P                  . / 3NR]P                  RR./ 3NR]P                  . / 3NR]P                  RR./ 3NR]P                  . / 3NR]P                  R./ 3NR]P                  . RR/3NR]P                  RR./ 3NR]P                  . / 3NR]P                  R./ 3NR]P                  RR./ 3NR]P                  . / 3NR]P                  . / 3NR]P                  . / 3NR]P                   . / 3NR]P"                  . / 3NR]P$                  . / 3NR]P&                  . / 3NR]P(                  . / 3NR ]P*                  . / 3NR!]P,                  . / 3NR"]P,                  RR./ 3NR#]P.                  . / 3NR$]P.                  RR./ 3NR%]P0                  . / 3NR&]P2                  . / 3NR']P2                  RR./ 3NR(]P4                  . / 3NR)]P4                  R*R+./ 3NR,]P6                  R-./ 3NR.]P8                  . / 3NR/]P8                  . R0^*/3NR1]P8                  . R2R3/3NR4]P:                  . / 3NR5]P:                  R*R6./ 3NR7]P<                  . / 3NR8]P<                  R9R:./ 3NtR;] R<&   R= R> lt!R? R@ lt"RAt#R-# )B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.exitCodezTA 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                   V ^8  d   QhRR/#    returnNone )formats   "9/usr/lib/python3/dist-packages/twisted/test/test_error.py__annotate__!StringificationTests.__annotate__   s     F FT F    c           
     	    V P                    FH  pV^ ,          pV^,          pV^,          pV^,          pV P                  \        V! V/ VB 4      V4       KJ  	  R# )r   N)r   assertEqualstr)selfentryoutput	exceptionargskwargss   &     r   testThemAll StringificationTests.testThemAll   sU    %%E1XFaI8D1XFSD!;F!;<fE &r"   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    r!      s     * *t *r"   c                ~    \        4       p\        P                  ! V4      pV P                  VP                  V4       R# )z@
L{error.ConnectingCancelledError} has an C{address} attribute.
N)objectr   ConnectingCancelledErrorassertIsaddress)r&   r3   es   &  r   test_connectingCancelledError2StringificationTests.test_connectingCancelledError   s-     (**73aii)r"   r   )$__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,   r5   __static_attributes__r   r"   r   r   r      sc   @^		5uBO^	 >OOG		
^	 BOOEN		
^	  1##T6<<./		
^	* 
()A)A2rJ+^	. 4$$EN		
-^	8 
u33R<9^	: 
'(<(<uenbQ;^	< 
/0B0BBK=^	@ ?O		
?^	L 7u		
K^	X DE"		
W^	b 
5112r:c^	d 
'(>(>QSTe^	h /""E"		
g^	r 
+E,B,BBKs^	t 
e00"b9u^	v 
1%2N2NPRTVWw^	x 
%e&<&<b"Ey^	z 
1%2D2Db"M{^	~ 5))		
}^	H 
$U__b"=I^	J 
3E4F4FBOK^	L 
"5>>2r:M^	P L  		
O^	\ U  EN		
[^	f 
*5+?+?RHg^	j 6  EN		
i^	v ))		
u^	@ 
4U5H5H"bQA^	D @EN		
C^	N 
78N8NPRTVWO^	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                  >    ] tR t^tRtR R ltR R ltR R ltRtR	# )
SubclassingTestsz5
Some exceptions are subclasses of other exceptions.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    SubclassingTests.__annotate__        R Rt Rr"   c                t    V P                  \        \        P                  \        P                  4      4       R# )zG
L{error.ConnectionClosed} is a superclass of L{error.ConnectionLost}.
N)
assertTrue
issubclassr   rL   ConnectionClosedr&   s   &r   -test_connectionLostSubclassOfConnectionClosed>SubclassingTests.test_connectionLostSubclassOfConnectionClosed   #     	
5#7#79O9OPQr"   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    rZ      r[   r"   c                t    V P                  \        \        P                  \        P                  4      4       R# )zG
L{error.ConnectionClosed} is a superclass of L{error.ConnectionDone}.
N)r]   r^   r   rM   r_   r`   s   &r   -test_connectionDoneSubclassOfConnectionClosed>SubclassingTests.test_connectionDoneSubclassOfConnectionClosed   rc   r"   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    rZ      s     K Kd Kr"   c                `    V P                  \        \        P                  \        4      4       R# )z@
L{ValueError} is a superclass of L{error.InvalidAddressError}.
N)r]   r^   r   InvalidAddressError
ValueErrorr`   s   &r   ,test_invalidAddressErrorSubclassOfValueError=SubclassingTests.test_invalidAddressErrorSubclassOfValueError   s     	
5#<#<jIJr"   r   N)	r7   r8   r9   r:   r;   ra   rf   rl   rV   r   r"   r   rX   rX      s    RRK Kr"   rX   c                  V    ] tR t^tRtR R ltR R ltR R ltR R	 ltR
 R lt	Rt
R# )GetConnectErrorTestsz
Given an exception instance thrown by C{socket.connect},
L{error.getConnectError} returns the appropriate high-level Twisted
exception instance.
c               $    V ^8  d   QhRRRRRR/# )r   errnointexpectedClasstype[error.ConnectError]r   r   r   )r   s   "r   r    !GetConnectErrorTests.__annotate__   s)     
L 
L
L)A
L	
Lr"   c                `    VR3p\         P                  ! V4      pV P                  VRWB4       R# )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&   rq   rs   r4   results   &&&  r   assertErrnoException)GetConnectErrorTests.assertErrnoException   s0     H&&q)##E8VKr"   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   rq   z
int | Nonemessager0   rz   zerror.ConnectErrorrs   rt   r   r   r   )r   s   "r   r    ru      s<     2 22 2 #	2
 02 
2r"   c                    V P                  VP                  V4       V P                  VP                  V4       V P                  VP                  V34       R# )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&   rq   r~   rz   rs   s   &&&&&r   ry   +GetConnectErrorTests.assertCorrectException   sD     	))=9/wj1r"   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    ru     s     P PD Pr"   c                    V P                  \        P                  \        P                  4       V P                  \        P
                  \        P                  4       V P                  \        P                  \        P                  4       \        P                  R8X  d_   V P                  \        P                  \        P                  4       V P                  \        P                  \        P                  4       R# R# )zG
L{error.getConnectError} converts based on errno for C{socket.error}.
win32N)r{   rq   ENETUNREACHr   rD   ECONNREFUSEDrE   	ETIMEDOUTrF   sysplatformWSAECONNREFUSEDWSAENETUNREACHr`   s   &r   
test_errnoGetConnectErrorTests.test_errno  s     	!!%"3"3U5G5GH!!%"4"4e6R6RS!!%//53I3IJ<<7"%%%%u'C'C %%e&:&:E<N<NO	 #r"   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    ru     s     Q Qt Qr"   c                    \         P                  ! \        P                  ! ^R4      4      pV P	                  ^RV\         P
                  4       R# )zg
L{error.getConnectError} converts to a L{error.UnknownHostError} given
a C{socket.gaierror} instance.
helloN)r   rx   r>   gaierrorry   rC   )r&   rz   s   & r   test_gaierror"GetConnectErrorTests.test_gaierror  s9    
 &&vr7'CD##B9O9OPr"   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r    ru     s     I It Ir"   c                    \        4       p\        P                  ! V4      pV P                  RW\        P                  4       R# )zi
L{error.getConnectError} converts to a L{error.ConnectError} given
an argument that cannot be unpacked.
N)	Exceptionr   rx   ry   rA   )r&   r4   rz   s   &  r   test_nonTuple"GetConnectErrorTests.test_nonTuple  s3    
 K&&q)##D!U5G5GHr"   r   N)r7   r8   r9   r:   r;   r{   ry   r   r   r   rV   r   r"   r   ro   ro      s*    
L2"PQI Ir"   ro   )
__future__r   rq   r>   r   typingr   twisted.internetr   twisted.trialr   SynchronousTestCaser   rX   ro   r   r"   r   <module>r      s[    #   
  " "y*877 y*xKx33 K0@I877 @Ir"   