Ϫfk&ddlmZddlZddlZddlZddlmZddlmZddl m Z Gdde jZ Gdd e jZ Gd d e jZy) ) annotationsN)Sequence)error)unittestceZdZUdZgdej gifdej dgifdej ddgifdej dd ejd fifd ejgifd ejddgifd ejgifdejddgifdejgifdejdgifdejgddifdejddgifdejgifdejdgifdejddgifdejgifdejgifdejgifdejgifdej gifdej"gifdej$gifdej&gifd ej(gifd!ej*gifd"ej*ddgifd#ej,gifd$ej,ddgifd%ej.gifd&ej0gifd'ej0ddgifd(ej2gifd)ej2d*d+gifd,ej4d-gifd.ej6gifd/ej6gd0d1ifd2ej6gd3d4ifd5ej8gifd6ej8d*d7gifd8ej:gifd9ej:d:d;gifZdZ d@d?Z!y-)AStringificationTestsz6Test 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.eth0iFoozMessage 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.x2zOA 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.signalSIGBUSzFThe 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.a12z_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 assertEqualstr)selfentryoutput exceptionargskwargss 9/usr/lib/python3/dist-packages/twisted/test/test_error.py testThemAllz StringificationTests.testThemAlls\%% FE1XFaI8D1XF   SD!;F!; OO G   ^  B OO EN   ^  1  # # T<6<<. /   ^ * ()A)A2rJ+^ . 4  $ $ EN   -^ 8 u33R<9^ : '(<((>QSTe^ h /  " " E "   g^ r +E,B,BBKs^ t e00"b9u^ v 1%2N2NPRTVWw^ x %e&<&>2r:M^ P L     O^ \ U  EN   [^ f *5+?+?RHg^ j 6  EN   i^ v   ) )    u^ @ 4U5H5H"bQA^ D @    EN   C^ N 78N8NPRTVWO^ 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^ eNF*r'rc(eZdZdZddZddZddZy)SubclassingTestsz= Some exceptions are subclasses of other exceptions. cr|jttjtjy)zW L{error.ConnectionClosed} is a superclass of L{error.ConnectionLost}. N) assertTrue issubclassrrFConnectionClosedrs r%-test_connectionLostSubclassOfConnectionClosedz>SubclassingTests.test_connectionLostSubclassOfConnectionClosed#  5#7#79O9OPQr'cr|jttjtjy)zW L{error.ConnectionClosed} is a superclass of L{error.ConnectionDone}. N)rTrUrrGrVrWs r%-test_connectionDoneSubclassOfConnectionClosedz>SubclassingTests.test_connectionDoneSubclassOfConnectionClosedrYr'c^|jttjty)zP L{ValueError} is a superclass of L{error.InvalidAddressError}. N)rTrUrInvalidAddressError ValueErrorrWs r%,test_invalidAddressErrorSubclassOfValueErrorz=SubclassingTests.test_invalidAddressErrorSubclassOfValueErrors  5#<# ECONNREFUSEDr? ETIMEDOUTr@sysplatformWSAECONNREFUSEDWSAENETUNREACHrWs r% test_errnozGetConnectErrorTests.test_errnos !!%"3"3U5G5GH !!%"4"4e6R6RS !!%//53I3IJ <<7 "  % %%%u'C'C   % %e&:&:Ers[# ""y*877y*xKx33K0@I877@Ir'