ó
    Ö›‘hƒ9  ã                   óä  • S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
JrJr  SSKJr  SSKJr   " S	 S
\5      r " S S\5      r " S S\R(                  5      r " S S\R(                  5      r " S S\
R.                  \R(                  \R0                  5      r " S S\R(                  \R0                  5      r\R6                  " \\5        \R6                  " \\5        \R8                  R;                  \5         " S S\R<                  5      r " S S\R@                  5      r! " S S\RD                  5      r# " S S\#5      r$ " S S\$5      r% " S S 5      r& " S! S"\RD                  5      r'g#)$z!
Tests for error handling in PB.
é    )ÚStringIO)Údefer)Úlog)Úqual)ÚflavorsÚjellyÚpb)ÚconnectedServerAndClient)Úunittestc                   ó   • \ rS rSrSrSrg)ÚAsynchronousExceptioné   z|
Helper used to test remote methods which return Deferreds which fail with
exceptions which are not L{pb.Error} subclasses.
© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    ÚfC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/spread/test/test_pbfailure.pyr   r      ó   † ôr   r   c                   ó   • \ rS rSrSrSrg)ÚSynchronousExceptioné   za
Helper used to test remote methods which raise exceptions which are not
L{pb.Error} subclasses.
r   Nr   r   r   r   r   r      r   r   r   c                   ó   • \ rS rSrSrSrg)ÚAsynchronousErroré"   zx
Helper used to test remote methods which return Deferreds which fail with
exceptions which are L{pb.Error} subclasses.
r   Nr   r   r   r   r   r   "   r   r   r   c                   ó   • \ rS rSrSrSrg)ÚSynchronousErroré)   z]
Helper used to test remote methods which raise exceptions which are
L{pb.Error} subclasses.
r   Nr   r   r   r   r!   r!   )   r   r   r!   c                   ó   • \ rS rSrSrg)Ú
JellyErroré0   r   N©r   r   r   r   r   r   r   r   r$   r$   0   ó   † Úr   r$   c                   ó   • \ rS rSrSrg)ÚSecurityErroré4   r   Nr&   r   r   r   r)   r)   4   r'   r   r)   c                   ó^   • \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rSS jrSS jrSrg)Ú
SimpleRooté>   c                 ó@   • [         R                  " [        S5      5      $ )z4
Fail asynchronously with a non-pb.Error exception.
zremote asynchronous exception)r   Úfailr   ©Úselfs    r   Úremote_asynchronousExceptionÚ'SimpleRoot.remote_asynchronousException?   s   € ô �zŠzÔ/Ð0OÓPÓQÐQr   c                 ó   • [        S5      e)z3
Fail synchronously with a non-pb.Error exception.
zremote synchronous exception)r   r0   s    r   Úremote_synchronousExceptionÚ&SimpleRoot.remote_synchronousExceptionE   s   € ô #Ð#AÓBÐBr   c                 ó@   • [         R                  " [        S5      5      $ )z0
Fail asynchronously with a pb.Error exception.
zremote asynchronous error)r   r/   r   r0   s    r   Úremote_asynchronousErrorÚ#SimpleRoot.remote_asynchronousErrorK   s   € ô �zŠzÔ+Ð,GÓHÓIÐIr   c                 ó   • [        S5      e)z/
Fail synchronously with a pb.Error exception.
zremote synchronous error)r!   r0   s    r   Úremote_synchronousErrorÚ"SimpleRoot.remote_synchronousErrorQ   s   € ô Ð9Ó:Ð:r   c                 óD   •  " S S[         R                  5      nU" S5      e)z.
Fail with error that is not known to client.
c                   ó   • \ rS rSrSrg)Ú4SimpleRoot.remote_unknownError.<locals>.UnknownErroré\   r   Nr&   r   r   r   ÚUnknownErrorr?   \   s   † Úr   rA   zI'm not known to client!)r	   ÚError)r1   rA   s     r   Úremote_unknownErrorÚSimpleRoot.remote_unknownErrorW   s    € ô
	œ2Ÿ8™8ô 	ñ Ð5Ó6Ð6r   c                 ó$   • U R                  5         g ©N)Ú
raiseJellyr0   s    r   Úremote_jellyÚSimpleRoot.remote_jellya   s   € Ø�‰Õr   c                 ó$   • U R                  5         g rF   )ÚraiseSecurityr0   s    r   Úremote_securityÚSimpleRoot.remote_securityd   s   € Ø×ÑÕr   c                 óˆ   • [         R                  " 5       nUR                  U R                  5        UR	                  S 5        U$ rF   )r   ÚDeferredÚaddCallbackrG   Úcallback©r1   Úds     r   Úremote_deferredJellyÚSimpleRoot.remote_deferredJellyg   s/   € Ü�NŠNÓˆØ	�‰�d—o‘oÔ&Ø	�
‰
�4ÔØˆr   c                 óˆ   • [         R                  " 5       nUR                  U R                  5        UR	                  S 5        U$ rF   )r   rO   rP   rK   rQ   rR   s     r   Úremote_deferredSecurityÚ"SimpleRoot.remote_deferredSecuritym   s1   € Ü�NŠNÓˆØ	�‰�d×(Ñ(Ô)Ø	�
‰
�4ÔØˆr   Nc                 ó   • [        S5      e)NzI'm jellyable!)r$   ©r1   Úresultss     r   rG   ÚSimpleRoot.raiseJellys   s   € ÜÐ)Ó*Ð*r   c                 ó   • [        S5      e)NzI'm secure!)r)   rZ   s     r   rK   ÚSimpleRoot.raiseSecurityv   s   € Ü˜MÓ*Ð*r   r   rF   )r   r   r   r   r2   r5   r8   r;   rC   rH   rL   rT   rW   rG   rK   r   r   r   r   r,   r,   >   s<   † òRòCòJò;ò7òòòòô+÷+r   r,   c                   ó"   • \ rS rSrSrSrS rSrg)ÚSaveProtocolServerFactoryéz   zX
A L{pb.PBServerFactory} that saves the latest connected client in
C{protocolInstance}.
Nc                 ó   • Xl         g)z#
Keep track of the given protocol.
N©ÚprotocolInstance)r1   Úprotocols     r   ÚclientConnectionMadeÚ.SaveProtocolServerFactory.clientConnectionMade‚   s
   € ð !)Õr   rc   )r   r   r   r   r   rd   rf   r   r   r   r   r`   r`   z   s   † ñð
 Ðõ)r   r`   c                   ó   • \ rS rSrSrS rSrg)ÚPBConnTestCaseé‰   r   c                 óî   ^ • [        [        5       5      T l        T R                  T R                  l        [        R
                  " 5       T l        [        U 4S jU 4S j5      u  T l        T l	        T l
        g )Nc                  ó:   >• T R                   R                  S 5      $ rF   )ÚserverFactoryÚbuildProtocolr0   s   €r   Ú<lambda>Ú&PBConnTestCase.setUp.<locals>.<lambda>•   ó   ø€ �D×&Ñ&×4Ñ4°TÔ:r   c                  ó:   >• T R                   R                  S 5      $ rF   )ÚclientFactoryrn   r0   s   €r   ro   rp   –   rq   r   )r`   r,   rm   ÚunsafeTracebacksr	   ÚPBClientFactoryrs   r
   ÚconnectedServerÚconnectedClientÚpumpr0   s   `r   ÚsetUpÚPBConnTestCase.setUpŒ   s]   ø€ Ü6´z³|ÓDˆÔØ.2×.CÑ.Cˆ×ÑÔ+Ü×/Ò/Ó1ˆÔô
 %Ü:Ü:ó
ñ		
ØÔ ØÔ Ø�Ir   )rs   rw   rv   rx   rm   N)r   r   r   r   rt   ry   r   r   r   r   ri   ri   ‰   s   † ØÐõ
r   ri   c                   óª   • \ rS rSr\R
                  R                  rS rS r	S r
S rS rS rS rSS
 jrS rS rS rS rS rS rS rS rS rSrg	)ÚPBFailureTestséš   c                 ó¶   ^ ^^^^• UUU 4S jmT R                   R                  5       nUU4S jnUR                  U5        T R                  R	                  5         g )Nc                 ó
  >• U R                  T5        TR                  U R                  S5        T(       a,  TR                  T5      nTR	                  [        U5      S5        U R                  U R                  U R                  4$ )NúTraceback unavailable
é   )ÚtrapÚcompareÚ	tracebackÚflushLoggedErrorsÚassertEqualÚlenÚtypeÚvalue)ÚerrÚerrsÚexceptionTypeÚflushr1   s     €€€r   ÚebÚ)PBFailureTests._exceptionTest.<locals>.ebž   sb   ø€ Ø�H‰H�]Ô#Ø�L‰L˜Ÿ™Ð(AÔBÞØ×-Ñ-¨mÓ<�Ø× Ñ ¤ T£¨AÔ.Ø—H‘H˜cŸi™i¨¯©Ð7Ð7r   c                 óL   >• U R                  T5      nUR                  T5        U$ rF   )Ú
callRemoteÚ
addErrback)ÚrootrS   rŽ   Úmethods     €€r   ÚgotRootObjectÚ4PBFailureTests._exceptionTest.<locals>.gotRootObject¨   s"   ø€ Ø—‘ Ó'ˆAØ�L‰L˜ÔØˆHr   ©rs   ÚgetRootObjectrP   rx   r�   )r1   r”   rŒ   r�   rS   r•   rŽ   s   ````  @r   Ú_exceptionTestÚPBFailureTests._exceptionTest�   s?   ü€ ÷	8ð ×Ñ×,Ñ,Ó.ˆö	ð
 	
�‰�mÔ$Ø�	‰	�‰Õr   c                 ó0   • U R                  S[        S5      $ )zˆ
Test that a Deferred returned by a remote method which already has a
Failure correctly has that error passed back to the calling side.
ÚasynchronousExceptionT)r™   r   r0   s    r   Útest_asynchronousExceptionÚ)PBFailureTests.test_asynchronousException°   s   € ð
 ×"Ñ"Ð#:Ô<QÐSWÓXÐXr   c                 ó0   • U R                  S[        S5      $ )z_
Like L{test_asynchronousException}, but for a method which raises an
exception synchronously.
ÚsynchronousExceptionT)r™   r   r0   s    r   Útest_synchronousExceptionÚ(PBFailureTests.test_synchronousException·   s   € ð
 ×"Ñ"Ð#9Ô;OÐQUÓVÐVr   c                 ó0   • U R                  S[        S5      $ )zu
Like L{test_asynchronousException}, but for a method which returns a
Deferred failing with an L{pb.Error} subclass.
ÚasynchronousErrorF)r™   r   r0   s    r   Útest_asynchronousErrorÚ%PBFailureTests.test_asynchronousError¾   s   € ð
 ×"Ñ"Ð#6Ô8IÈ5ÓQÐQr   c                 ó0   • U R                  S[        S5      $ )ze
Like L{test_asynchronousError}, but for a method which synchronously
raises a L{pb.Error} subclass.
ÚsynchronousErrorF)r™   r!   r0   s    r   Útest_synchronousErrorÚ$PBFailureTests.test_synchronousErrorÅ   s   € ð
 ×"Ñ"Ð#5Ô7GÈÓOÐOr   c                 ó(   • U R                  X5        U$ rF   )r†   )r1   ÚresultÚexpectedResults      r   Ú_successÚPBFailureTests._successÌ   s   € Ø×Ñ˜Ô0Øˆr   c                 ó<   • UR                  U R                  X24S9  U$ )N)ÚcallbackArgs)ÚaddCallbacksr®   )r1   Ú
remoteCallr­   rŽ   s       r   Ú_addFailingCallbacksÚ#PBFailureTests._addFailingCallbacksÐ   s"   € Ø×Ñ §¡¨rÐ@QÐÑRØÐr   Nc                 ó¬   ^ ^^^^• T R                   R                  5       nUUUUU 4S jnUR                  U5        T R                  R	                  5         g)z¦
Call the given remote method and attach the given errback to the
resulting Deferred.  If C{exc} is not None, also assert that one
exception of that type was logged.
c                 ó‚   >• TR                  U R                  T5      TT5      nTb  UU4S jnUR                  U5        U$ )Nc                 ó\   >• TR                  [        TR                  T5      5      S5        U $ )Nr�   )r†   r‡   r…   )rŠ   Úexcr1   s    €€r   Ú
gotFailureÚ@PBFailureTests._testImpl.<locals>.gotRootObj.<locals>.gotFailureâ   s(   ø€ Ø×$Ñ$¤S¨×)?Ñ)?ÀÓ)DÓ%EÀqÔIØ�Jr   )r´   r‘   ÚaddBoth)ÚobjÚfailureDeferredrº   rŽ   r¹   Úexpectedr”   r1   s      €€€€€r   Ú
gotRootObjÚ,PBFailureTests._testImpl.<locals>.gotRootObjÜ   sE   ø€ Ø"×7Ñ7Ø—‘˜vÓ&¨°"óˆOð ‰öð  ×'Ñ'¨
Ô3Ø"Ð"r   Nr—   )r1   r”   r¿   rŽ   r¹   ÚrootDeferredrÀ   s   `````  r   Ú	_testImplÚPBFailureTests._testImplÔ   sA   ü€ ð ×)Ñ)×7Ñ7Ó9ˆ÷	#ñ 	#ð 	× Ñ  Ô,Ø�	‰	�‰Õr   c                 ó6   ^ • U 4S jnT R                  SSU5      $ )z
Test that an exception which is a subclass of L{pb.Error} has more
information passed across the network to the calling side.
c                 ó¼   >• U R                  [        5        TR                  U R                  [        5        TR                  U R                  U R                  5        g)Né+   ©r‚   r$   ÚassertNotIsInstancerˆ   ÚstrÚassertIsInstancer‰   ©r/   r1   s    €r   ÚfailureJellyÚ6PBFailureTests.test_jellyFailure.<locals>.failureJellyò   s>   ø€ Ø�I‰I”jÔ!Ø×$Ñ$ T§Y¡Y´Ô4Ø×!Ñ! $§*¡*¨d¯i©iÔ8Ør   r   rÇ   ©rÃ   )r1   rÍ   s   ` r   Útest_jellyFailureÚ PBFailureTests.test_jellyFailureì   s   ø€ õ	ð �~‰~˜g r¨<Ó8Ð8r   c                 ó6   ^ • U 4S jnT R                  SSU5      $ )zw
Test that a Deferred which fails with a L{pb.Error} is treated in
the same way as a synchronously raised L{pb.Error}.
c                 ó¼   >• U R                  [        5        TR                  U R                  [        5        TR                  U R                  U R                  5        g)Né®  rÈ   rÌ   s    €r   ÚfailureDeferredJellyÚFPBFailureTests.test_deferredJellyFailure.<locals>.failureDeferredJelly   s>   ø€ Ø�I‰I”jÔ!Ø×$Ñ$ T§Y¡Y´Ô4Ø×!Ñ! $§*¡*¨d¯i©iÔ8Ør   ÚdeferredJellyrÔ   rÏ   )r1   rÕ   s   ` r   Útest_deferredJellyFailureÚ(PBFailureTests.test_deferredJellyFailureú   s   ø€ õ	ð �~‰~˜o¨sÐ4HÓIÐIr   c                 ó6   ^ • U 4S jnT R                  SSU5      $ )zŒ
A non-jellyable L{pb.Error} subclass raised by a remote method is
turned into a Failure with a type set to the FQPN of the exception
type.
c                 ó>   >• TR                  U R                  S5        g)Ns3   twisted.spread.test.test_pbfailure.SynchronousErroré¯  ©r†   rˆ   rÌ   s    €r   ÚfailureUnjellyableÚBPBFailureTests.test_unjellyableFailure.<locals>.failureUnjellyable  s    ø€ Ø×ÑØ—	‘	ÐQôð r   r¨   rÜ   rÏ   )r1   rÞ   s   ` r   Útest_unjellyableFailureÚ&PBFailureTests.test_unjellyableFailure  s   ø€ õ	ð �~‰~Ð0°#Ð7IÓJÐJr   c                 ó6   ^ • U 4S jnT R                  SSU5      $ )zw
Test that an exception which is a subclass of L{pb.Error} but not
known on the client side has its type set properly.
c                 ó>   >• TR                  U R                  S5        g)Ns/   twisted.spread.test.test_pbfailure.UnknownErroréÖ  rÝ   rÌ   s    €r   ÚfailureUnknownÚ:PBFailureTests.test_unknownFailure.<locals>.failureUnknown  s    ø€ Ø×ÑØ—	‘	ÐMôð r   ÚunknownErrorrä   rÏ   )r1   rå   s   ` r   Útest_unknownFailureÚ"PBFailureTests.test_unknownFailure  s   ø€ õ	ð �~‰~˜n¨d°NÓCÐCr   c                 ó6   ^ • U 4S jnT R                  SSU5      $ )z´
Test that even if an exception is not explicitly jellyable (by being
a L{pb.Jellyable} subclass), as long as it is an L{pb.Error}
subclass it receives the same special treatment.
c                 ó¼   >• U R                  [        5        TR                  U R                  [        5        TR                  U R                  U R                  5        g)NéÌ  ©r‚   r)   rÉ   rˆ   rÊ   rË   r‰   rÌ   s    €r   ÚfailureSecurityÚ<PBFailureTests.test_securityFailure.<locals>.failureSecurity,  s>   ø€ Ø�I‰I”mÔ$Ø×$Ñ$ T§Y¡Y´Ô4Ø×!Ñ! $§*¡*¨d¯i©iÔ8Ør   Úsecurityrì   rÏ   )r1   rî   s   ` r   Útest_securityFailureÚ#PBFailureTests.test_securityFailure%  s   ø€ õ	ð �~‰~˜j¨$°Ó@Ð@r   c                 ó6   ^ • U 4S jnT R                  SSU5      $ )zª
Test that a Deferred which fails with a L{pb.Error} which is not
also a L{pb.Jellyable} is treated in the same way as a synchronously
raised exception of the same type.
c                 ó¼   >• U R                  [        5        TR                  U R                  [        5        TR                  U R                  U R                  5        g)Néø§  rí   rÌ   s    €r   ÚfailureDeferredSecurityÚEPBFailureTests.test_deferredSecurity.<locals>.failureDeferredSecurity;  s>   ø€ Ø�I‰I”mÔ$Ø×$Ñ$ T§Y¡Y´Ô4Ø×!Ñ! $§*¡*¨d¯i©iÔ8Ør   ÚdeferredSecurityrõ   rÏ   )r1   rö   s   ` r   Útest_deferredSecurityÚ$PBFailureTests.test_deferredSecurity4  s   ø€ õ	ð �~‰~Ð0°%Ð9PÓQÐQr   c                 ó@   ^ • U 4S jnT R                  SSU[        5      $ )zx
Test that attempting to call a method which is not defined correctly
results in an AttributeError on the calling side.
c                 ó|   >• U R                  [        R                  5        TR                  U R                  S5        g)Nr€   é¤  )r‚   r	   ÚNoSuchMethodrƒ   r„   rÌ   s    €r   ÚfailureNoSuchÚ>PBFailureTests.test_noSuchMethodFailure.<locals>.failureNoSuchI  s)   ø€ Ø�I‰I”b—o‘oÔ&Ø�L‰L˜Ÿ™Ð)BÔCØr   Únosuchrý   )rÃ   ÚAttributeError)r1   rÿ   s   ` r   Útest_noSuchMethodFailureÚ'PBFailureTests.test_noSuchMethodFailureC  s   ø€ õ	ð
 �~‰~˜h¨¨}¼nÓMÐMr   c                 óÄ   ^ • T R                   R                  5       nS nUR                  U5        U 4S jnUR                  U5        T R                  R                  5         g)zÄ
Test that a copied failure received from a PB call can be logged
locally.

Note: this test needs some serious help: all it really tests is that
log.err(copiedFailure) doesn't raise an exception.
c                 ó$   • U R                  S5      $ )Nr    )r‘   )ÚrootObjs    r   Ú	connectedÚ;PBFailureTests.test_copiedFailureLogging.<locals>.connectedZ  s   € Ø×%Ñ%Ð&<Ó=Ð=r   c                 ó’   >• [         R                  " U 5        TR                  [        5      nTR	                  [        U5      S5        g )Né   )r   rŠ   r…   r   r†   r‡   )Úfailurer‹   r1   s     €r   Ú	exceptionÚ;PBFailureTests.test_copiedFailureLogging.<locals>.exception_  s4   ø€ Ü�GŠG�GÔØ×)Ñ)Ô*>Ó?ˆDØ×ÑœS ›Y¨Õ*r   N)rs   r˜   rP   r’   rx   r�   )r1   rS   r  r  s   `   r   Útest_copiedFailureLoggingÚ(PBFailureTests.test_copiedFailureLoggingP  sM   ø€ ð ×Ñ×,Ñ,Ó.ˆò	>ð 	
�‰�iÔ õ	+ð
 	
�‰�YÔØ�	‰	�‰Õr   c                 óL  ^ ^• [         R                  " [        S5      5      n[        R                  " [        R                  " U[        5       S95      n/ mUU 4S jnU" 5       nUR                  S5        T R                  [        UR                  U5        T R                  [        T5      S5        TS   nT R                  UR                  [        [        5      R                  S5      5        T R                  UR                  S5        T R                  UR                   S	5        g)
z‘
L{pb.CopiedFailure.throwExceptionIntoGenerator} will throw a
L{RemoteError} into the given paused generator at the point where it
last yielded.
Úfoo©Úinvokerc               3   óž   >#   •  S v •  TR                  S5        g ! [        R                   a  n TR                  U 5         S n A g S n A ff = f7f)NzRemoteError not raised)r/   r	   ÚRemoteErrorÚappend)r¹   r  r1   s    €€r   ÚgeneratorFuncÚFPBFailureTests.test_throwExceptionIntoGenerator.<locals>.generatorFuncq  sE   øé € ð4Ø’
ð —	‘	Ð2Õ3øô —>‘>ó &Ø× Ñ  ×%Ñ%ûð&üs*   ƒA… ‰A›A
¯AÁ AÁA
Á
ANr�   r   Úascii)r  r€   )r	   ÚCopyableFailurer  r   ÚunjellyÚDummyInvokerÚsendÚassertRaisesÚStopIterationÚthrowExceptionIntoGeneratorr†   r‡   Ú
remoteTyper   ÚencodeÚargsÚremoteTraceback)r1   ÚoriginalÚcopyr  Úgenr¹   r  s   `     @r   Ú test_throwExceptionIntoGeneratorÚ/PBFailureTests.test_throwExceptionIntoGeneratorg  s×   ù€ ô ×%Ò%¤n°UÓ&;Ó<ˆÜ�}Š}œUŸ[š[¨¼<»>ÑJÓKˆØˆ	ö	4ñ ‹oˆØ�‰�ŒØ×Ñœ-¨×)IÑ)IÈ3ÔOØ×Ñœ˜Y›¨Ô+Ø˜‰lˆØ×Ñ˜Ÿ™¬¬nÓ)=×)DÑ)DÀWÓ)MÔNØ×Ñ˜Ÿ™ 8Ô,Ø×Ñ˜×,Ñ,Ð.GÕHr   r   rF   )r   r   r   r   r   ÚTestCaser†   rƒ   r™   r�   r¡   r¥   r©   r®   r´   rÃ   rÐ   rØ   rà   rè   rñ   rù   r  r  r)  r   r   r   r   r|   r|   š   ss   † Ø×Ñ×+Ñ+€Gòò&YòWòRòPòòôò09òJòKòDòAòRòNòõ.Ir   r|   c                   óD   • \ rS rSr\R
                  R                  rSrSr	g)ÚPBFailureUnsafeTestsiƒ  r�   r   N)
r   r   r   r   r   r+  ÚfailIfEqualsrƒ   rt   r   r   r   r   r-  r-  ƒ  s   † Ø×Ñ×,Ñ,€GØÓr   r-  c                   ó   • \ rS rSrSrSrSrg)r  iˆ  zN
A behaviorless object to be used as the invoker parameter to
L{jelly.jelly}.
Nr   )r   r   r   r   r   ÚserializingPerspectiver   r   r   r   r  r  ˆ  s   † ñð
 "Ór   r  c                   ó*   • \ rS rSrSrS rS rS rSrg)ÚFailureJellyingTestsi‘  z2
Tests for the interaction of jelly and failures.
c                 óê  • [         R                  " [        5       5      nU R                  UR	                  [        5      [        5        U R                  UR	                  [
        5      [
        5        [        R                  " [        R                  " U[        5       S95      nU R                  UR	                  [        5      [        5        U R                  UR	                  [
        5      [
        5        g)z‚
An unjellied L{CopyableFailure} has a check method which behaves the
same way as the original L{CopyableFailure}'s check method.
r  N©	r	   r  ÚZeroDivisionErrorÚassertIsÚcheckÚArithmeticErrorr   r  r  )r1   r&  Úcopieds      r   Útest_unjelliedFailureCheckÚ/FailureJellyingTests.test_unjelliedFailureCheck–  s“   € ô
 ×%Ò%Ô&7Ó&9Ó:ˆØ�‰�h—n‘nÔ%6Ó7Ô9JÔKØ�‰�h—n‘n¤_Ó5´ÔGÜ—’œuŸ{š{¨8¼\»^ÑLÓMˆØ�‰�f—l‘lÔ#4Ó5Ô7HÔIØ�‰�f—l‘l¤?Ó3´_ÕEr   c                 óx  • [         R                  " [        5       5      nU R                  UR	                  [        5      [        5        U R                  UR	                  [
        5      [
        5        [        R                  " [        R                  " U[        5       S95      n[         R                  " U5      n[        R                  " [        R                  " U[        5       S95      nU R                  UR	                  [        5      [        5        U R                  UR	                  [
        5      [
        5        g)a(  
The object which results from jellying a L{CopyableFailure}, unjellying
the result, creating a new L{CopyableFailure} from the result of that,
jellying it, and finally unjellying the result of that has a check
method which behaves the same way as the original L{CopyableFailure}'s
check method.
r  Nr4  )r1   r&  Ú
copiedOnceÚ
derivativeÚcopiedTwices        r   Útest_twiceUnjelliedFailureCheckÚ4FailureJellyingTests.test_twiceUnjelliedFailureCheck¢  sÂ   € ô ×%Ò%Ô&7Ó&9Ó:ˆØ�‰�h—n‘nÔ%6Ó7Ô9JÔKØ�‰�h—n‘n¤_Ó5´ÔGÜ—]’]¤5§;¢;¨xÄÃÑ#PÓQˆ
Ü×'Ò'¨
Ó3ˆ
Ü—m’m¤E§K¢K°
ÄLÃNÑ$SÓTˆØ�‰�k×'Ñ'Ô(9Ó:Ô<MÔNØ�‰�k×'Ñ'¬Ó8¼/ÕJr   c                 óX  • [         R                  " [        S5      5      n[        R                  " [        R                  " U[        5       S95      n[        5       nUR                  U5        [        [        5      nSR                  U5      nU R                  XSR                  5       5        g)zì
When L{CopiedFailure.printTraceback} is used to print a copied failure
which was unjellied from a L{CopyableFailure} with C{unsafeTracebacks}
set to C{False}, the string representation of the exception value is
included in the output.
zsome reasonr  z.Traceback from remote host -- {}: some reason
N)r	   r  Ú	Exceptionr   r  r  r   ÚprintTracebackr   Úformatr†   Úgetvalue)r1   r&  r9  Úoutputr  ÚexpectedOutputs         r   Ú test_printTracebackIncludesValueÚ5FailureJellyingTests.test_printTracebackIncludesValue³  s|   € ô ×%Ò%¤i°Ó&>Ó?ˆÜ—’œuŸ{š{¨8¼\»^ÑLÓMˆÜ“ˆØ×Ñ˜fÔ%Üœ“Oˆ	ØM×TÑTØó
ˆð 	×Ñ˜¯©Ó):Õ;r   r   N)	r   r   r   r   r   r:  r@  rI  r   r   r   r   r2  r2  ‘  s   † ñò
FòKõ"<r   r2  N)(r   Úior   Útwisted.internetr   Útwisted.pythonr   Útwisted.python.reflectr   Útwisted.spreadr   r   r	   Útwisted.test.iosimr
   Útwisted.trialr   rC  r   r   rB   r   r!   Ú	JellyableÚ
RemoteCopyr$   r)   ÚsetUnjellyableForClassÚglobalSecurityÚallowInstancesOfÚRootr,   ÚPBServerFactoryr`   r+  ri   r|   r-  r  r2  r   r   r   Ú<module>rY     s4  ðñõ å "Ý Ý 'ß -Ñ -Ý 7Ý "ô
˜Iô ô˜9ô ô˜Ÿ™ô ô�r—x‘xô ô	�×"Ñ" B§H¡H¨b¯m©mô 	ô	�B—H‘H˜bŸm™mô 	ð × Ò ˜* jÔ 1Ø × Ò ˜-¨Ô 7Ø × Ñ × "Ñ " =Ô 1ô9+�—‘ô 9+ôx) × 2Ñ 2ô )ô
�X×&Ñ&ô 
ô"fI�^ô fIôR˜>ô ÷
"ñ "ô1<˜8×,Ñ,õ 1<r   