ó
    Ö›‘h6÷  ã                   ó$  • S r SSKrSSK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KJrJr  SSKJrJrJr  SSKJrJr  SS	KJrJrJrJr  SS
KJrJrJr  SSK J!r!  SSK"J#r#  SSK$J%r%  SSK&J'r'J(r(  SSK)J*r*  SSK+J,r,J-r-J.r.J/r/  SSK0J1r1   " S S\-Rd                  5      r3 " S S\-Rh                  5      r5\" \Rl                  5       " S S5      5       r7 " S S5      r8S r9 " S S5      r: " S S\#5      r;S�S jr< " S  S!\-Rz                  5      r> " S" S#\-Rz                  5      r? " S$ S%\-R€                  5      rA " S& S'\-R„                  5      rC\-Rˆ                  " \A\C5         " S( S)\-R€                  5      rES* rF\-RŽ                  " \E\F5         " S+ S,\-Rz                  5      rH " S- S.\-R’                  5      rJ " S/ S0\-Rz                  5      rK " S1 S2\-R’                  5      rL " S3 S4\-Rš                  5      rN\-Rˆ                  " \L\N5         " S5 S6\-Rš                  5      rO\-Rˆ                  " \J\O5         " S7 S8\-Rz                  5      rP " S9 S:\-Rz                  5      rQ " S; S<\-Rz                  5      rR " S= S>\-Rz                  5      rS " S? S@\-R€                  \-R„                  5      rT\-Rˆ                  " \T\T5         " SA SB\-R€                  \-R„                  5      rU\-Rˆ                  " \U\U5         " SC SD\-R’                  \-Rš                  5      rV\-Rˆ                  " \V\V5         " SE SF\-R®                  5      rX " SG SH\-R®                  5      rY " SI SJ\1R´                  5      r[ " SK SL\-R¸                  5      r] " SM SN\1R¼                  5      r_ " SO SP\1R¼                  5      r`SQraSqbSqcSR rd " SS ST\-Rz                  5      re " SU SV\-Rz                  5      rf " SW SX\1R¼                  5      rg " SY SZ\.RÐ                  5      ri " S[ S\\.RÔ                  5      rk " S] S^\-Rz                  5      rl\-Rˆ                  " \i\k5         " S_ S`\1R¼                  5      rm " Sa Sb\n5      ro " Sc Sd\-R€                  5      rp " Se Sf\-Rz                  5      rq " Sg Sh\/Rä                  5      rs\" \-Rè                  5       " Si Sj\-Rh                  5      5       ru " Sk Sl5      rv " Sm Sn\-Rd                  5      rw " So Sp\v5      rx " Sq Sr\1R¼                  5      ry " Ss St\1R¼                  5      rz\" \-Rè                  5       " Su Sv5      5       r{ " Sw Sx\1R¼                  5      r| " Sy Sz\5      r}\" \}5       " S{ S|5      5       r~ " S} S~\1R¼                  5      r " S S€\1R¼                  5      r€g)‚z�
Tests for Perspective Broker module.

TODO: update protocol level tests to use new connection API, leaving
only specific tests for old API.
é    N)Údeque)ÚBytesIO)ÚDict)Ú	InterfaceÚimplementer)ÚcheckersÚcredentialsÚportal)ÚUnauthorizedLoginÚUnhandledCredentials)ÚaddressÚmainÚprotocolÚreactor)ÚDeferredÚgatherResultsÚsucceed)ÚConnectionRefusedError)Ú_FakeConnector)ÚWrappingFactory)ÚfailureÚlog)Ú	iterbytes)ÚjellyÚpbÚpublishÚutil)Úunittestc                   ó   • \ rS rSrS rSrg)ÚDummyé'   c                 ó0   • [        U[        5      (       a  gg)Nzhello world!zgoodbye, cruel world!)Ú
isinstanceÚDummyPerspective©ÚselfÚusers     Ú_C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/spread/test/test_pb.pyÚview_doNothingÚDummy.view_doNothing(   s   € Ü�dÔ,×-Ñ-Ø!à*ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r)   Ú__static_attributes__r,   r+   r(   r    r    '   s   † õ+r+   r    c                   ó   • \ rS rSrSrS rSrg)r$   é/   z=
An L{IPerspective} avatar which will be used in some tests.
c                 ó   • [        5       $ ©N)r    ©r&   s    r(   Úperspective_getDummyViewPointÚ.DummyPerspective.perspective_getDummyViewPoint4   s	   € Ü‹wˆr+   r,   N)r-   r.   r/   r0   Ú__doc__r7   r1   r,   r+   r(   r$   r$   /   s   † ñõr+   r$   c                   ó   • \ rS rSrS rSrg)Ú
DummyRealmé8   c                 ó^   • U H'  nU[         R                  L d  M  U[        U5      S 4s  $    g )Nc                  ó   • g r5   r,   r,   r+   r(   Ú<lambda>Ú*DummyRealm.requestAvatar.<locals>.<lambda>=   s   € À$r+   )r   ÚIPerspectiver$   )r&   ÚavatarIdÚmindÚ
interfacesÚifaces        r(   ÚrequestAvatarÚDummyRealm.requestAvatar:   s+   € ÛˆEØœŸ™Ô'ØÔ.¨xÓ8¹,ÐFÒFò  r+   r,   N)r-   r.   r/   r0   rF   r1   r,   r+   r(   r;   r;   8   s   † õGr+   r;   c                   ó0   • \ rS rSrSrS rS rS rS rSr	g)	ÚIOPumpé@   zƒ
Utility to pump data between clients and servers for protocol testing.

Perhaps this is a utility worthy of being in protocol.py?
c                 ó4   • Xl         X l        X0l        X@l        g r5   )ÚclientÚserverÚclientIOÚserverIO)r&   rL   rM   rN   rO   s        r(   Ú__init__ÚIOPump.__init__G   s   € ØŒØŒØ ŒØ �r+   c                 ó  • SU l         [        R                  " 5       S-   nU R                   (       dZ  U R                  5       (       aD  [        R                  " 5       U:”  a  gU R                   (       d  U R                  5       (       a  MB  gggg)z£
Pump until there is no more input or output or until L{stop} is called.
This does not run any timers, so don't use it with any code that calls
reactor.callLater.
Fé   N)Ú_stopÚtimeÚpump)r&   Útimeouts     r(   ÚflushÚIOPump.flushM   sU   € ð ˆŒ
Ü—)’)“+ ‘/ˆØ—*—* §¡§¡Ü�yŠy‹{˜WÓ$Øð —*—* §¡§¤�* �*r+   c                 ó   • SU l         g)zL
Stop a running L{flush} operation, even if data remains to be
transferred.
TN)rT   r6   s    r(   ÚstopÚIOPump.stopZ   s   € ð
 ˆ�
r+   c                 ó  • U R                   R                  S5        U R                  R                  S5        U R                   R                  5       nU R                  R                  5       nU R                   R                  S5        U R                  R                  S5        U R                   R	                  5         U R                  R	                  5         U R
                  R                  R                  5         U R                  R                  R                  5         [        U5       H  nU R                  R                  U5        M      [        U5       H  nU R
                  R                  U5        M      U(       d  U(       a  gg)z@
Move data back and forth.

Returns whether any data was moved.
r   é   )rN   ÚseekrO   ÚreadÚtruncaterL   Ú	transportÚ_checkProducerrM   r   ÚdataReceived)r&   ÚcDataÚsDataÚbytes       r(   rV   ÚIOPump.pumpa   s	  € ð 	�‰×Ñ˜1ÔØ�‰×Ñ˜1ÔØ—‘×"Ñ"Ó$ˆØ—‘×"Ñ"Ó$ˆØ�‰×Ñ˜1ÔØ�‰×Ñ˜1ÔØ�‰×ÑÔ Ø�‰×ÑÔ Ø�‰×Ñ×,Ñ,Ô.Ø�‰×Ñ×,Ñ,Ô.Ü˜eÖ$ˆDØ�K‰K×$Ñ$ TÖ*ñ %ä˜eÖ$ˆDØ�K‰K×$Ñ$ TÖ*ñ %æ–EØàr+   )rT   rL   rN   rM   rO   N)
r-   r.   r/   r0   r9   rP   rX   r[   rV   r1   r,   r+   r(   rI   rI   @   s   † ñò!òòõr+   rI   c                 óÀ  ^• SnTR                  U5      nUR                  U5      n[        5       n[        5       nUR                  [        R                  " U5      5        UR                  [        R                  " U5      5        [        XEXg5      nS n	U4S jn
U R                  X”5        U R                  X•5        U R                  U
5        UR                  5         XEU4$ )a8  
Create a server and a client and connect the two with an
L{IOPump}.

@param test: the test case where the client and server will be
    used.
@type test: L{twisted.trial.unittest.TestCase}

@param clientFactory: The factory that creates the client object.
@type clientFactory: L{twisted.spread.pb.PBClientFactory}

@param serverFactory: The factory that creates the server object.
@type serverFactory: L{twisted.spread.pb.PBServerFactory}

@return: a 3-tuple of (client, server, pump)
@rtype: (L{twisted.spread.pb.Broker}, L{twisted.spread.pb.Broker},
    L{IOPump})
)ú	127.0.0.1c                 óŽ   • U R                   (       d4  U R                  [        R                  " [        R
                  5      5        g g r5   )ÚdisconnectedÚconnectionLostr   ÚFailurer   ÚCONNECTION_DONE)Úbrokers    r(   ÚmaybeDisconnectÚ/connectServerAndClient.<locals>.maybeDisconnect™   s-   € Ø×"×"Ø×!Ñ!¤'§/¢/´$×2FÑ2FÓ"GÕHð #r+   c                  ój   >• T R                  S [        R                  " [        R                  5      S9  g )N)Ú	connectorÚreason)ÚclientConnectionLostr   rn   r   ro   )ÚclientFactorys   €r(   ÚdisconnectClientFactoryÚ7connectServerAndClient.<locals>.disconnectClientFactory�   s,   ø€ ð
 	×*Ñ*Ø¤7§?¢?´4×3GÑ3GÓ#Hð 	+ò 	
r+   )ÚbuildProtocolÚStringIOÚmakeConnectionr   ÚFileWrapperrI   Ú
addCleanuprV   )Útestrw   ÚserverFactoryÚaddrÚclientBrokerÚserverBrokerÚclientTransportÚserverTransportrV   rq   rx   s    `         r(   ÚconnectServerAndClientr†   {   s¼   ø€ ð& €DØ ×.Ñ.¨tÓ4€LØ ×.Ñ.¨tÓ4€Lä“j€OÜ“j€Oà×Ñ¤× 4Ò 4°_Ó EÔFØ×Ñ¤× 4Ò 4°_Ó EÔFÜ�,¨oÓO€DòIõ
ð 	‡O�O�OÔ2Ø‡O�O�OÔ2Ø‡O�OÐ+Ô,à‡I�I„KØ tÐ+Ð+r+   c                   ó*   • \ rS rSrSrS rS rS rSrg)Ú_ReconnectingFakeConnectorStateé®   zÐ
Manages connection notifications for a
L{_ReconnectingFakeConnector} instance.

@ivar notifications: pending L{Deferreds} that will fire when the
    L{_ReconnectingFakeConnector}'s connect method is called
c                 ó"   • [        5       U l        g r5   )r   Únotificationsr6   s    r(   rP   Ú(_ReconnectingFakeConnectorState.__init__·   s   € Ü"›WˆÕr+   c                 óP   • [        5       nU R                  R                  U5        U$ )z²
Connection notification.

@return: A L{Deferred} that fires when this instance's
    L{twisted.internet.interfaces.IConnector.connect} method
    is called.
@rtype: L{Deferred}
)r   r‹   Ú
appendleft)r&   Únotifiers     r(   ÚnotifyOnConnectÚ/_ReconnectingFakeConnectorState.notifyOnConnectº   s$   € ô “:ˆØ×Ñ×%Ñ% hÔ/Øˆr+   c                 ó    • U R                   (       a=  U R                   R                  5       R                  U 5        U R                   (       a  M<  gg)z!
Fire all pending notifications.
N)r‹   ÚpopÚcallbackr6   s    r(   Ú	notifyAllÚ)_ReconnectingFakeConnectorState.notifyAllÇ   s8   € ð × × Ø×Ñ×"Ñ"Ó$×-Ñ-¨dÔ3ð × × Ó r+   )r‹   N)	r-   r.   r/   r0   r9   rP   r�   r•   r1   r,   r+   r(   rˆ   rˆ   ®   s   † ñò%òõ4r+   rˆ   c                   ó8   ^ • \ rS rSrSrU 4S jrU 4S jrSrU =r$ )Ú_ReconnectingFakeConnectoréÏ   zW
A fake L{IConnector} that can fire L{Deferred}s when its
C{connect} method is called.
c                 ó0   >• [         TU ]  U5        X l        g)zÕ
@param address: An L{IAddress} provider that represents this
    connector's destination.
@type address: An L{IAddress} provider.

@param state: The state instance
@type state: L{_ReconnectingFakeConnectorState}
N)ÚsuperrP   Ú_state)r&   r   ÚstateÚ	__class__s      €r(   rP   Ú#_ReconnectingFakeConnector.__init__Õ   s   ø€ ô 	‰Ñ˜Ô!Ø�r+   c                 óV   >• [         TU ]  5         U R                  R                  5         g)z=
A C{connect} implementation that calls C{reconnectCallback}
N)r›   Úconnectrœ   r•   )r&   rž   s    €r(   r¡   Ú"_ReconnectingFakeConnector.connectá   s   ø€ ô 	‰‰ÔØ�‰×ÑÕr+   )rœ   )	r-   r.   r/   r0   r9   rP   r¡   r1   Ú__classcell__)rž   s   @r(   r˜   r˜   Ï   s   ø† ñõ

÷ ó  r+   r˜   c                 óè   • U=(       d
    [        5       n[        R                  " SS9n[        R                  " [
        R                  " X/5      5      n[        R                  " 5       n[        XU5      $ )zª
Connect a client and server L{Broker} together with an L{IOPump}

@param realm: realm to use, defaulting to a L{DummyRealm}

@returns: a 3-tuple (client, server, pump).
ó   guest)Úguest)	r;   r   Ú'InMemoryUsernamePasswordDatabaseDontUser   ÚPBServerFactoryr
   ÚPortalÚPBClientFactoryr†   )r   ÚrealmÚcheckerr€   rw   s        r(   ÚconnectedServerAndClientr­   é   sV   € ð ×!”Z“\€EÜ×>Ò>ÀXÑN€GÜ×&Ò&¤v§}¢}°U¸IÓ'FÓG€MÜ×&Ò&Ó(€MÜ! $°}ÓEÐEr+   c                   ó    • \ rS rSrS rS rSrg)ÚSimpleRemoteéø   c                 ó   • Xl         US-   $ ©Nr^   ©Úarg©r&   r´   s     r(   Úremote_thunkÚSimpleRemote.remote_thunkù   ó   € ØŒØ�Q‰wˆr+   c                 ó   • [        5       er5   )Ú	Exceptionrµ   s     r(   Úremote_knuthÚSimpleRemote.remote_knuthý   s
   € Ü‹kÐr+   r³   N)r-   r.   r/   r0   r¶   r»   r1   r,   r+   r(   r¯   r¯   ø   s   † òõr+   r¯   c                   ó   • \ rS rSrS rSrg)ÚNestedRemotei  c                 ó   • [        5       $ r5   )r¯   r6   s    r(   Úremote_getSimpleÚNestedRemote.remote_getSimple  s
   € Ü‹~Ðr+   r,   N)r-   r.   r/   r0   rÀ   r1   r,   r+   r(   r¾   r¾     s   † õr+   r¾   c                   ó   • \ rS rSrS rSrg)Ú
SimpleCopyi  c                 ó4   • SU l         SS0U l        S/U l        g ©Nr^   ÚHelloÚWorldr   ©ÚxÚyÚzr6   s    r(   rP   ÚSimpleCopy.__init__  ó   € ØˆŒØ˜7Ð#ˆŒØ�ˆ�r+   rÈ   N©r-   r.   r/   r0   rP   r1   r,   r+   r(   rÃ   rÃ     ó   † õr+   rÃ   c                   ó   • \ rS rSrSrg)ÚSimpleLocalCopyi  r,   N©r-   r.   r/   r0   r1   r,   r+   r(   rÑ   rÑ     ó   † Úr+   rÑ   c                   ó8   • \ rS rSr% Sr0 r\\S 4   \S'   S r	Sr
g)ÚSimpleFactoryCopyi  zQ
@cvar allIDs: hold every created instances of this class.
@type allIDs: C{dict}
ÚallIDsc                 ó6   • Xl         U [        R                  U'   g r5   )ÚidrÕ   rÖ   )r&   rØ   s     r(   rP   ÚSimpleFactoryCopy.__init__  s   € ØŒØ'+Ô× Ñ  Ò$r+   )rØ   N)r-   r.   r/   r0   r9   rÖ   r   ÚintÚ__annotations__rP   r1   r,   r+   r(   rÕ   rÕ     s#   ‡ ñð
 .0€FˆD�Ð)Ð)Ñ*Ó/õ,r+   rÕ   c                 ó  • U R                  SS5      nUc  [        S[        U 5       35      eU[        R                  ;  a  [        S[        R                   35      e[        R                  U   nU(       d  [        S5      eU$ )z`
Factory of L{SimpleFactoryCopy}, getting a created instance given the
C{id} found in C{state}.
rØ   Nz&factory copy state has no 'id' member zfactory class has no ID: z&factory method found no object with id)ÚgetÚRuntimeErrorÚreprrÕ   rÖ   )r�   ÚstateIdÚinsts      r(   ÚcreateFactoryCopyrâ   !  s~   € ð
 �i‰i˜˜dÓ#€GØ�ÜÐCÄDÈÃKÀ=ÐQÓRÐRØÔ'×.Ñ.Ó.ÜÐ6Ô7H×7OÑ7OÐ6PÐQÓRÐRÜ×#Ñ# GÑ,€DÞÜÐCÓDÐDØ€Kr+   c                   ó    • \ rS rSrS rS rSrg)Ú
NestedCopyi4  c                 ó   • [        5       $ r5   )rÃ   r6   s    r(   Úremote_getCopyÚNestedCopy.remote_getCopy5  s
   € Ü‹|Ðr+   c                 ó   • [        U5      $ r5   )rÕ   )r&   Úvalues     r(   Úremote_getFactoryÚNestedCopy.remote_getFactory8  s   € Ü  Ó'Ð'r+   r,   N)r-   r.   r/   r0   ræ   rê   r1   r,   r+   r(   rä   rä   4  s   † òõ(r+   rä   c                   ó   • \ rS rSrS rSrg)ÚSimpleCachei<  c                 ó4   • SU l         SS0U l        S/U l        g rÅ   rÈ   r6   s    r(   Ú	__init___ÚSimpleCache.__init___=  rÍ   r+   rÈ   N)r-   r.   r/   r0   rï   r1   r,   r+   r(   rí   rí   <  rÏ   r+   rí   c                   ó    • \ rS rSrS rS rSrg)ÚNestedComplicatedCacheiC  c                 ó"   • [        5       U l        g r5   )ÚVeryVeryComplicatedCacheableÚcr6   s    r(   rP   ÚNestedComplicatedCache.__init__D  s   € Ü-Ó/ˆ�r+   c                 ó   • U R                   $ r5   ©rõ   r6   s    r(   Úremote_getCacheÚ&NestedComplicatedCache.remote_getCacheG  s   € Ø�v‰vˆr+   rø   N)r-   r.   r/   r0   rP   rù   r1   r,   r+   r(   rò   rò   C  s   † ò0õr+   rò   c                   ó,   • \ rS rSrS rS rS rS rSrg)rô   iK  c                 ó.   • SU l         SU l        SU l        g )Nr^   é   é   ©rÉ   rÊ   Úfoor6   s    r(   rP   Ú%VeryVeryComplicatedCacheable.__init__L  s   € ØˆŒØˆŒØˆ�r+   c                 óJ   • SU l         U R                  R                  SS5        g )Né   r   )r   ÚobserverÚ
callRemoter6   s    r(   ÚsetFoo4Ú$VeryVeryComplicatedCacheable.setFoo4Q  s   € ØˆŒØ�‰× Ñ  ¨Õ*r+   c                 óV   • X l         U R                  U R                  U R                  S.$ )Nrÿ   )r  rÉ   rÊ   r   ©r&   Úperspectiver  s      r(   ÚgetStateToCacheAndObserveForÚ9VeryVeryComplicatedCacheable.getStateToCacheAndObserveForU  s    € Ø ŒØ—V‘V $§&¡&°·±Ñ:Ð:r+   c                 ó€   • [         R                  " S5        UR                  S5        X R                  :X  a  S U l        g g )Nzstopped observingÚend)r   Úmsgr  r  r	  s      r(   ÚstoppedObservingÚ-VeryVeryComplicatedCacheable.stoppedObservingY  s3   € Ü�ŠÐ#Ô$Ø×Ñ˜EÔ"Ø—}‘}Ó$Ø ˆD�Mð %r+   )r   r  rÉ   rÊ   N)	r-   r.   r/   r0   rP   r  r  r  r1   r,   r+   r(   rô   rô   K  s   † òò
+ò;õ!r+   rô   c                   ó    • \ rS rSrS rS rSrg)ÚRatherBaroqueCachei`  c                 ó   • Xl         g r5   ©r   )r&   ÚnewFoos     r(   Úobserve_fooÚRatherBaroqueCache.observe_fooa  s   € Ø�r+   c                 ó0   • [         R                  " S5        g )Nzthe end of things)r   r  r6   s    r(   Úobserve_endÚRatherBaroqueCache.observe_endd  s   € Ü�ŠÐ#Õ$r+   r  N)r-   r.   r/   r0   r  r  r1   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)ÚSimpleLocalCacheik  c                 ó:   • U R                   R                  U5        g r5   )Ú__dict__Úupdate)r&   r�   s     r(   ÚsetCopyableStateÚ!SimpleLocalCache.setCopyableStatel  s   € Ø�‰×Ñ˜UÕ#r+   c                 ó   • U R                   $ r5   )Úcheckr6   s    r(   ÚcheckMethodÚSimpleLocalCache.checkMethodo  ó   € Ø�z‰zÐr+   c                 ó   • U $ r5   r,   r6   s    r(   Ú	checkSelfÚSimpleLocalCache.checkSelfr  s   € Øˆr+   c                 ó   • gr²   r,   r6   s    r(   r$  ÚSimpleLocalCache.checku  s   € Ør+   r,   N)	r-   r.   r/   r0   r!  r%  r)  r$  r1   r,   r+   r(   r  r  k  s   † ò$òòõr+   r  c                   ó&   • \ rS rSrS rS rS rSrg)ÚNestedCachei|  c                 ó"   • [        5       U l        g r5   )rí   rÉ   r6   s    r(   rP   ÚNestedCache.__init__}  s   € Ü“ˆ�r+   c                 ó2   • U R                   U R                   /$ r5   ©rÉ   r6   s    r(   rù   ÚNestedCache.remote_getCache€  s   € Ø—‘˜Ÿ™ÐÐr+   c                 ó   • U R                   UL $ r5   r2  ©r&   Úcaches     r(   Úremote_putCacheÚNestedCache.remote_putCacheƒ  s   € Ø�v‰v˜ˆÐr+   r2  N)r-   r.   r/   r0   rP   rù   r7  r1   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)Ú
Observablei‡  c                 ó   • / U l         g r5   ©Ú	observersr6   s    r(   rP   ÚObservable.__init__ˆ  s	   € Øˆ�r+   c                 ó:   • U R                   R                  U5        g r5   )r=  Úappend©r&   Úobss     r(   Úremote_observeÚObservable.remote_observe‹  ó   € Ø�‰×Ñ˜cÕ"r+   c                 ó:   • U R                   R                  U5        g r5   )r=  ÚremoverA  s     r(   Úremote_unobserveÚObservable.remote_unobserveŽ  rE  r+   c                 óN   • U R                    H  nUR                  SX5        M     g )NÚnotify)r=  r  )r&   Úobjr  s      r(   rK  ÚObservable.notify‘  s    € ØŸœˆHØ×Ñ ¨$Ö4ò 'r+   r<  N)	r-   r.   r/   r0   rP   rC  rH  rK  r1   r,   r+   r(   r:  r:  ‡  s   † òò#ò#õ5r+   r:  c                   ó,   • \ rS rSrS rS rS rS rSrg)ÚDeferredRemotei–  c                 ó   • SU l         g )Nr   ©Úrunr6   s    r(   rP   ÚDeferredRemote.__init__—  s	   € Øˆ�r+   c                 ó   • Xl         US-   $ r²   rQ  rµ   s     r(   ÚrunMeÚDeferredRemote.runMeš  r¸   r+   c                 ó   •  S5       e)Nzshouldn't have been run!r,   rµ   s     r(   Ú	dontRunMeÚDeferredRemote.dontRunMež  s   € Ø,Ð,Ó,ˆqr+   c                 ór   • [        5       nUR                  U R                  U R                  5        Xl        U$ )zW
Return a L{Deferred} to be fired on client side. When fired,
C{self.runMe} is called.
)r   ÚaddCallbacksrU  rX  Úd)r&   r\  s     r(   Úremote_doItLaterÚDeferredRemote.remote_doItLater¡  s+   € ô
 ‹JˆØ	�‰�t—z‘z 4§>¡>Ô2ØŒØˆr+   )r\  rR  N)	r-   r.   r/   r0   rP   rU  rX  r]  r1   r,   r+   r(   rO  rO  –  s   † òòò-õr+   rO  c                   ó"   • \ rS rSrSrSrS rSrg)ÚObserveri¬  r   Nc                 ó\   • X l         U R                  S-   U l        UR                  SU 5        g )Nr^   Ú	unobserve)rL  Únotifiedr  )r&   ÚotherrL  s      r(   Úremote_notifyÚObserver.remote_notify°  s'   € ØŒØŸ™¨Ñ)ˆŒØ×Ñ˜ dÕ+r+   )rc  rL  )r-   r.   r/   r0   rc  rL  re  r1   r,   r+   r(   r`  r`  ¬  s   † Ø€HØ
€Cõ,r+   r`  c                   ó   • \ rS rSrS rSrg)ÚNewStyleCopyi¶  c                 ó   • Xl         g r5   ©Ús)r&   rk  s     r(   rP   ÚNewStyleCopy.__init__·  s   € Ø�r+   rj  NrÎ   r,   r+   r(   rh  rh  ¶  s   † õr+   rh  c                   ó,   • \ rS rSrSrSrSrS rS rSr	g)ÚNewStyleCopy2i¾  r   r^   c                 óp   • [         =R                  S-  sl        [        R                  U 5      nSUl        U$ )Nr^   rý   )rn  Ú	allocatedÚobjectÚ__new__ré   )r&   rá   s     r(   rr  ÚNewStyleCopy2.__new__Ã  s-   € Ü×Ò 1Ñ$ÕÜ�~‰~˜dÓ#ˆØˆŒ
Øˆr+   c                 ó6   • [         =R                  S-  sl        g r²   )rn  Úinitializedr6   s    r(   rP   ÚNewStyleCopy2.__init__É  s   € Ü×!Ò! QÑ&Ö!r+   r,   N)
r-   r.   r/   r0   rp  ru  ré   rr  rP   r1   r,   r+   r(   rn  rn  ¾  s   † Ø€IØ€KØ€Eòõ'r+   rn  c                   ó   • \ rS rSrS rSrg)ÚNewStyleCacheCopyiÐ  c                 ó   • U R                   $ r5   )r  r	  s      r(   r  Ú.NewStyleCacheCopy.getStateToCacheAndObserveForÑ  s   € Ø�}‰}Ðr+   r,   N)r-   r.   r/   r0   r  r1   r,   r+   r(   rx  rx  Ð  s   † õr+   rx  c                   ó    • \ rS rSrS rS rSrg)ÚEchoeriØ  c                 ó   • U$ r5   r,   ©r&   Ústs     r(   Úremote_echoÚEchoer.remote_echoÙ  s   € Øˆ	r+   c                 ó   • X4$ r5   r,   )r&   r  Úkws      r(   Úremote_echoWithKeywordsÚEchoer.remote_echoWithKeywordsÜ  s	   € Øˆxˆr+   r,   N)r-   r.   r/   r0   r€  r„  r1   r,   r+   r(   r|  r|  Ø  s   † òõr+   r|  c                   ó    • \ rS rSrS rS rSrg)ÚCachedReturnerià  c                 ó   • Xl         g r5   ©r6  r5  s     r(   rP   ÚCachedReturner.__init__á  s   € Ø�
r+   c                 ó   • U R                   $ r5   r‰  r~  s     r(   Úremote_giveMeCacheÚ!CachedReturner.remote_giveMeCacheä  r'  r+   r‰  N)r-   r.   r/   r0   rP   rŒ  r1   r,   r+   r(   r‡  r‡  à  s   † òõr+   r‡  c                   ó2   • \ rS rSrS rS rS rS rS rSr	g)	ÚNewStyleTestsiè  c                 óþ   • [         R                  " [        5       5      U l        [         R                  " 5       n[        XU R                  S9u  o l        U l        U R                  UR                  5       5      U l
        g)zI
Create a pb server using L{Echoer} protocol and connect a client to it.
)r   rw   r€   N)r   r¨   r|  r€   rª   r†   rM   rV   ÚsuccessResultOfÚgetRootObjectÚref)r&   rw   rL   s      r(   ÚsetUpÚNewStyleTests.setUpé  sb   € ô  ×/Ò/´³Ó9ˆÔÜ×*Ò*Ó,ˆÜ)?ØÀ$×BTÑBTñ*
Ñ&ˆ”˜TœYð ×'Ñ'¨×(CÑ(CÓ(EÓFˆ�r+   c                 óF   • S[         l        S[         l        S[         l        g)zX
Close client and server connections, reset values of L{NewStyleCopy2}
class variables.
r   r^   N)rn  rp  ru  ré   r6   s    r(   ÚtearDownÚNewStyleTests.tearDownô  s   € ð
 #$ŒÔØ$%ŒÔ!ØŒÕr+   c                 ó¼   ^ ^• [        S5      mT R                  R                  ST5      nT R                  R	                  5         UU 4S jnUR                  U5        U$ )zI
Create a new style object, send it over the wire, and check the result.
ré   Úechoc                 ó�   >• TR                  U [        5        TR                  U R                  S5        TR	                  U TL 5        g )Nré   )ÚassertIsInstancerh  ÚassertEqualrk  ÚassertFalse©ÚresÚorigr&   s    €€r(   ÚcbÚ'NewStyleTests.test_newStyle.<locals>.cb  s9   ø€ Ø×!Ñ! #¤|Ô4Ø×Ñ˜SŸU™U GÔ,Ø×Ñ˜S D˜[Õ)r+   ©rh  r“  r  rV   rX   ÚaddCallback©r&   r\  r¢  r¡  s   `  @r(   Útest_newStyleÚNewStyleTests.test_newStyleý  sK   ù€ ô ˜GÓ$ˆØ�H‰H×Ñ ¨Ó-ˆØ�	‰	�‰Ôö	*ð
 	
�‰�bÔØˆr+   c                 ó:  ^ ^• [        5       mT R                  [         R                  S5        T R                  [         R                  S5        T R                  R                  ST5      nT R                  R                  5         UU 4S jnUR                  U5        U$ )z>
Send a new style object and check the number of allocations.
r^   rš  c                 ó  >• TR                  U [        5        TR                  U R                  S5        TR                  [        R                  S5        TR                  [        R
                  S5        TR                  U T5        g )Nrý   rþ   r^   )rœ  rn  r�  ré   rp  ru  ÚassertIsNotrŸ  s    €€r(   r¢  Ú$NewStyleTests.test_alloc.<locals>.cb  sc   ø€ à×!Ñ! #¤}Ô5Ø×Ñ˜SŸY™Y¨Ô*Ø×Ñœ]×4Ñ4°aÔ8Ø×Ñœ]×6Ñ6¸Ô:Ø×Ñ˜S $Õ'r+   )	rn  r�  rp  ru  r“  r  rV   rX   r¥  r¦  s   `  @r(   Ú
test_allocÚNewStyleTests.test_alloc  st   ù€ ô ‹ˆØ×Ñœ×0Ñ0°!Ô4Ø×Ñœ×2Ñ2°AÔ6Ø�H‰H×Ñ ¨Ó-ˆØ�	‰	�‰Ôö	(ð 	
�‰�bÔØˆr+   c                 ó¼   ^ ^• [        S5      mT R                  R                  STSSS9nT R                  R	                  5         UU 4S jnUR                  U5        U$ )zW
Create a new style object with keywords,
send it over the wire, and check the result.
Úvalue1ÚechoWithKeywordsÚoneÚtwo©Úkeyword1Úkeyword2c                 ó.  >• TR                  U [        5        TR                  U S   [        5        TR                  U S   [        5        TR	                  U S   R
                  S5        TR                  U S   T5        TR	                  U S   SSS.5        g )Nr   r^   r°  r²  r³  r´  )rœ  Útuplerh  Údictr�  rk  r«  rŸ  s    €€r(   r¢  Ú3NewStyleTests.test_newStyleWithKeywords.<locals>.cb.  s€   ø€ Ø×!Ñ! #¤uÔ-Ø×!Ñ! # a¡&¬,Ô7Ø×!Ñ! # a¡&¬$Ô/Ø×Ñ˜S ™VŸX™X xÔ0Ø×Ñ˜S ™V TÔ*Ø×Ñ˜S ™V°%ÀUÑ%KÕLr+   r¤  r¦  s   `  @r(   Útest_newStyleWithKeywordsÚ'NewStyleTests.test_newStyleWithKeywords#  sZ   ù€ ô
 ˜HÓ%ˆØ�H‰H×ÑØ ¨u¸uð  ð 
ˆð 	�	‰	�‰Ôö	Mð 	
�‰�bÔØˆr+   )rV   r“  rM   r€   N)
r-   r.   r/   r0   r”  r—  r§  r­  r»  r1   r,   r+   r(   r�  r�  è  s   † ò	Gò òò õ,r+   r�  c                   ó(   • \ rS rSrSrSrS rS rSrg)ÚConnectionNotifyServerFactoryi:  aJ  
A server factory which stores the last connection and fires a
L{Deferred} on connection made. This factory can handle only one
client connection.

@ivar protocolInstance: the last protocol instance.
@type protocolInstance: C{pb.Broker}

@ivar connectionMade: the deferred fired upon connection.
@type connectionMade: C{Deferred}
Nc                 ó`   • [         R                  R                  X5        [        5       U l        g)z
Initialize the factory.
N)r   r¨   rP   r   ÚconnectionMade)r&   Úroots     r(   rP   Ú&ConnectionNotifyServerFactory.__init__I  s"   € ô 	×Ñ×#Ñ# DÔ/Ü&›jˆÕr+   c                 ó`   • Xl         U R                  Sso l        Ub  UR                  S5        gg)z6
Store the protocol and fire the connection deferred.
N)ÚprotocolInstancerÀ  r”   )r&   r   r\  s      r(   ÚclientConnectionMadeÚ2ConnectionNotifyServerFactory.clientConnectionMadeP  s3   € ð !)ÔØ!%×!4Ñ!4°dÐˆÔØ‰=Ø�J‰J�tÕð r+   )rÀ  rÄ  )	r-   r.   r/   r0   r9   rÄ  rP   rÅ  r1   r,   r+   r(   r¾  r¾  :  s   † ñ
ð Ðò)õr+   r¾  c                   ó&   • \ rS rSrS rS rS rSrg)ÚNewStyleCachedTestsiZ  c                 óô  ^ • [        5       T l        ST R                  l        [        R                  " S[        [        T R                  5      5      5      T l        [        R                  " 5       n[        R                  " ST R                  R                  5       R                  U5        U 4S jnUR                  5       R                  U5      nT R                  R                  R                   n[#        X4/5      $ )zQ
Create a pb server using L{CachedReturner} protocol and connect a
client to it.
ré   r   Ú	localhostc                 ó   >• U Tl         g r5   )r“  )r“  r&   s    €r(   ÚgotRootÚ*NewStyleCachedTests.setUp.<locals>.gotRooth  s
   ø€ ØˆD�Hr+   )rx  r¡  rk  r   Ú	listenTCPr¾  r‡  rM   r   rª   Ú
connectTCPÚgetHostÚportr’  r¥  ÚfactoryrÀ  r   )r&   rw   rÌ  Úd1Úd2s   `    r(   r”  ÚNewStyleCachedTests.setUp[  s·   ø€ ô
 &Ó'ˆŒ	Øˆ�	‰	ŒÜ×'Ò'ØÔ,¬^¸D¿I¹IÓ-FÓGó
ˆŒô ×*Ò*Ó,ˆÜ×Ò˜;¨¯©×(;Ñ(;Ó(=×(BÑ(BÀMÔRõ	ð ×(Ñ(Ó*×6Ñ6°wÓ?ˆØ�[‰[× Ñ ×/Ñ/ˆÜ˜b˜XÓ&Ð&r+   c                 ó  • U R                   R                  R                  R                  R	                  5         U R
                  R                  R                  R	                  5         U R                   R                  5       $ )z&
Close client and server connections.
)rM   rÒ  rÄ  rb   ÚloseConnectionr“  rp   ÚstopListeningr6   s    r(   r—  ÚNewStyleCachedTests.tearDowno  sS   € ð 	�‰×Ñ×,Ñ,×6Ñ6×EÑEÔGØ�‰�‰×!Ñ!×0Ñ0Ô2Ø�{‰{×(Ñ(Ó*Ð*r+   c                 ó¨   ^ • T R                   R                  ST R                  5      nU 4S jnUR                  US5        UR                  US5        U$ )z­
A new-style cacheable object can be retrieved and re-retrieved over a
single connection.  The value of an attribute of the cacheable can be
accessed on the receiving side.
ÚgiveMeCachec                 ó
  >• TR                  U [        5        TR                  SU R                  5        TR	                  TR
                  U 5        U(       a-  U Tl        TR                  R                  STR
                  5      $ g )Nré   rÛ  )	rœ  rx  r�  rk  r«  r¡  r   r“  r  )r   Úagainr&   s     €r(   r¢  Ú2NewStyleCachedTests.test_newStyleCache.<locals>.cb  sh   ø€ Ø×!Ñ! #Ô'8Ô9Ø×Ñ˜W c§e¡eÔ,à×Ñ˜TŸY™Y¨Ô,æà�”ð —x‘x×*Ñ*¨=¸$¿)¹)ÓDÐDð r+   TF)r“  r  r¡  r¥  )r&   r\  r¢  s   `  r(   Útest_newStyleCacheÚ&NewStyleCachedTests.test_newStyleCachew  sH   ø€ ð �H‰H×Ñ ¨t¯y©yÓ9ˆõ	Eð 	
�‰�b˜$ÔØ	�‰�b˜%Ô Øˆr+   )r¡  r“  r   rM   N)r-   r.   r/   r0   r”  r—  rß  r1   r,   r+   r(   rÈ  rÈ  Z  s   † ò'ò(+õ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 rS rS rS rS rS rS rS rS rSrg)ÚBrokerTestsi‘  Nc                 óR   •  [         R                  " S5        g ! [         a     g f = f)NúNone-None-TESTING.pub)ÚosÚunlinkÚOSErrorr6   s    r(   r—  ÚBrokerTests.tearDown”  s&   € ð	ä�IŠIÐ-Õ.øÜó 	Ùð	ús   ‚ ™
&¥&c                 ó,   • U R                  SU 35        g )Nz&This should cause a return value, not ©Úfail)r&   Úerrors     r(   ÚthunkErrorBadÚBrokerTests.thunkErrorBad›  s   € Ø�	‰	Ð:¸5¸'ÐBÕCr+   c                 ó   • Xl         g r5   )ÚthunkResult©r&   Úresults     r(   ÚthunkResultGoodÚBrokerTests.thunkResultGoodž  s   € Ø!Õr+   c                 ó   • g r5   r,   )r&   Útbs     r(   ÚthunkErrorGoodÚBrokerTests.thunkErrorGood¡  ó   € Ør+   c                 ó,   • U R                  SU 35        g )Nz This should cause an error, not rê  rñ  s     r(   ÚthunkResultBadÚBrokerTests.thunkResultBad¤  s   € Ø�	‰	Ð4°V°HÐ=Õ>r+   c                 ó
  • [        U S9u  pn " S S[        R                  5      n " S S[        R                  5      nUR                  SU" 5       5        UR	                  S5      nU" 5       nU" 5       nUR                  SXx5        UR                  5         UR                  5         UR                  5         U R                  UR                  US5        U R                  UR                  S5      UR                  S5      5        g )	N©r   c                   ó   • \ rS rSrS rSrg)Ú%BrokerTests.test_reference.<locals>.Xiª  c                 ó   • Xl         g r5   ©Úcaughtrµ   s     r(   Úremote_catchÚ2BrokerTests.test_reference.<locals>.X.remote_catch«  s   € Ø!•r+   r  N)r-   r.   r/   r0   r  r1   r,   r+   r(   ÚXr   ª  s   † õ"r+   r  c                   ó   • \ rS rSrS rSrg)Ú%BrokerTests.test_reference.<locals>.Yi®  c                 ó(   • UR                  SU5        g )NÚcatch©r  ©r&   ÚaÚbs      r(   Úremote_throwÚ2BrokerTests.test_reference.<locals>.Y.remote_throw¯  s   € Ø—‘˜W aÕ(r+   r,   N)r-   r.   r/   r0   r  r1   r,   r+   r(   ÚYr  ®  s   † õ)r+   r  rÊ   ÚthrowzX should have caught Z)r­   r   ÚReferenceableÚsetNameForLocalÚremoteForNamer  rV   ÚassertIsr  r�  ÚremoteMethod)	r&   rõ   rk  rV   r  r  rÊ   rÉ   rË   s	            r(   Útest_referenceÚBrokerTests.test_reference§  sÆ   € Ü-°4Ñ8‰
ˆˆdô	"”× Ñ ô 	"ô	)”× Ñ ô 	)ð 	
×Ñ˜#™q›sÔ#Ø�O‰O˜CÓ ˆÙ‹CˆÙ‹CˆØ	�‰�W˜aÔ#Ø�	‰	ŒØ�	‰	ŒØ�	‰	ŒØ�‰�a—h‘h Ð#;Ô<ð 	×Ñ˜Ÿ™¨Ó0°!·.±.ÀÓ2IÕJr+   c                 ó¶  • [        U S9u  pnX4X!44 HÃ  u  pE[        5       nUR                  SU5        UR                  S5      nSU l        UR                  SU R                  S-
  5      R                  U R                  U R                  5        UR                  5         UR                  5         U R                  U R                  U R                  S5        MÅ     g )Nrþ  r   é   Úthunkr^   zresult wasn't received.)r­   r¯   r  r  ÚexpectedThunkResultr  r[  ró  rí  rV   r�  rð  )r&   rõ   rk  rV   rÉ   rÊ   r   Úbars           r(   Útest_resultÚBrokerTests.test_result¿  s¼   € Ü-°4Ñ8‰
ˆˆdØ�F˜Q˜F“N‰DˆAä“.ˆCØ×Ñ˜e SÔ)Ø—/‘/ %Ó(ˆCØ'(ˆDÔ$Ø�N‰N˜7 D×$<Ñ$<¸qÑ$@ÓA×NÑNØ×$Ñ$ d×&8Ñ&8ôð �I‰IŒKà�I‰IŒKà×ÑØ× Ñ  $×":Ñ":Ð<Uöò #r+   c                 ó   • Xl         g r5   )ÚnestedRemoterñ  s     r(   ÚrefcountResultÚBrokerTests.refcountResultÓ  s   € Ø"Õr+   c           
      ó†  • / n/ n[        U S9u  p4n[        5       nUR                  SU5        UR                  S5      n[	        [
        R                  S-   5       H€  nUR                  R                  (       d  UR                  R                  (       a    OIUR                  S5      R                  UR                  UR                  5        UR                  5         M‚     [
        R                  S-
  n	U R                  UR                  R                  S5        U R                  [        U5      U	SU	 S[        U5       35        g )	Nrþ  r   é
   Ú	getSimpler^   ztransport was not closedz	expected z got )r­   r¾   r  r  Úranger   ÚMAX_BROKER_REFSrb   Úclosedr  r[  r@  rV   Ú
assertTruer�  Úlen)
r&   ÚlÚerõ   rk  rV   r   rÉ   ÚignoÚexpecteds
             r(   Útest_tooManyRefsÚBrokerTests.test_tooManyRefsÖ  sñ   € ØˆØˆÜ-°4Ñ8‰
ˆˆdÜ‹nˆØ	×Ñ˜% Ô%Ø�O‰O˜EÓ"ˆÜœ"×,Ñ,¨rÑ1Ö2ˆDØ�{‰{×!×! Q§[¡[×%7×%7ÙØ�L‰L˜Ó%×2Ñ2°1·8±8¸Q¿X¹XÔFØ�I‰IŽKñ	 3ô
 ×%Ñ%¨Ñ)ˆØ�‰˜Ÿ™×*Ñ*Ð,FÔGØ×Ñœ˜Q› ¨Y°x°jÀÄcÈ!ÃfÀXÐ+NÕOr+   c                 ó  • [        U S9u  pn[        5       nUR                  SU5        UR                  S5      nUR	                  S5      R                  U R                  U R                  5        UR                  5         UR                  5         U R                  U R                  R                  S5        U R                  U R                  R                  S   S5        U R                  U R                  R                  S   S5        g )	Nrþ  r   ÚgetCopyr^   rÆ   rÇ   r   r   )r­   rä   r  r  r  r[  ró  rí  rV   r�  rð  rÉ   rÊ   rË   )r&   rõ   rk  rV   r   rÉ   s         r(   Ú	test_copyÚBrokerTests.test_copyæ  sÊ   € Ü-°4Ñ8‰
ˆˆdÜ‹lˆØ	×Ñ˜% Ô%Ø�O‰O˜EÓ"ˆØ	�‰�YÓ×,Ñ,¨T×-AÑ-AÀ4×CUÑCUÔVØ�	‰	ŒØ�	‰	ŒØ×Ñ˜×)Ñ)×+Ñ+¨QÔ/Ø×Ñ˜×)Ñ)×+Ñ+¨GÑ4°gÔ>Ø×Ñ˜×)Ñ)×+Ñ+¨AÑ.°Õ7r+   c                 ó  • [        U S9u  pn[        5       n[        5       nUR                  SU5        UR	                  S5      nUR                  SU5        UR                  5         UR                  S5        UR                  5         UR                  5         UR                  S5        UR                  5         UR                  5         U R                  UR                  S5        U R                  UR                  SS5        g )Nrþ  r  Úobserver^   r&  zdidn't notifyznotified too much)r­   r:  r`  r  r  r  rV   rK  ÚassertIsNotNonerL  r�  )r&   rõ   rk  rV   r  r  Úras          r(   Útest_observeÚBrokerTests.test_observeò  sº   € Ü-°4Ñ8‰
ˆˆdô ‹LˆÜ‹JˆØ	×Ñ˜#˜qÔ!Ø�_‰_˜SÓ!ˆØ
�‰�i Ô#Ø�	‰	ŒØ	�‰�ŒØ�	‰	ŒØ�	‰	ŒØ	�‰�ŒØ�	‰	ŒØ�	‰	ŒØ×Ñ˜QŸU™U OÔ4Ø×Ñ˜Ÿ™ Ð#6Õ7r+   c                 ób  • [        U S9u  pn[        5       nUR                  SU5        UR                  S5      nUR	                  5         UR	                  5         / nUR                  S5      R                  UR                  5        UR	                  5         UR	                  5         U R                  UR                  S5        UR                  R                  S5        U R                  UR                  SS5        UR	                  5         UR	                  5         U R                  US   SS	5        g )
Nrþ  r\  Ú	doItLaterzDeferred method run too early.rS   zDeferred method run too late.r   é   zIncorrect result.)r­   rO  r  r  rV   r  r¥  r@  rž  rR  r\  r”   r�  )r&   rõ   rk  rV   r\  r.  Úresultss          r(   Ú
test_deferÚBrokerTests.test_defer  sÞ   € Ü-°4Ñ8‰
ˆˆdÜÓˆØ	×Ñ˜#˜qÔ!Ø�O‰O˜CÓ ˆØ�	‰	ŒØ�	‰	ŒØˆØ	�‰�[Ó!×-Ñ-¨g¯n©nÔ=Ø�	‰	ŒØ�	‰	ŒØ×Ñ˜Ÿ™Ð @ÔAØ	�‰�‰�QŒØ×Ñ˜Ÿ™ Ð#BÔCØ�	‰	ŒØ�	‰	ŒØ×Ñ˜ ™ QÐ(;Õ<r+   c                 ón  • [        U S9u  pn[        5       nUR                  SU5        UR                  S5      nUR	                  S5      R                  U R                  U R                  5        UR                  5         UR                  5         U R                  R                  nU R                  XbR                  5        U ?	[        R                  S:¼  a  [        R                   " 5         UR                  5         UR                  5         UR                  5         U R#                  XbR                  5        g )Nrþ  r   r'  é   )r­   r¾   r  r  r  r[  r#  rí  rV   r"  ÚluidÚassertInÚlocalObjectsÚsysÚ
hexversionÚgcÚcollectÚassertNotIn)r&   rõ   rk  rV   r   r  Úrluids          r(   Útest_refcountÚBrokerTests.test_refcount  sÜ   € Ü-°4Ñ8‰
ˆˆdÜ‹nˆØ	×Ñ˜% Ô%Ø�o‰o˜eÓ$ˆØ�‰�{Ó#×0Ñ0Ø×Ñ ×!3Ñ!3ô	
ð
 	�	‰	Œà�	‰	Œð ×!Ñ!×&Ñ&ˆØ�‰�eŸ^™^Ô,ØÐä�>‰>˜YÓ&Ü�JŠJŒLà�	‰	ŒØ�	‰	ŒØ�	‰	ŒØ×Ñ˜§¡Õ/r+   c                 ó  • [        U S9u  pn[        5       n[        5       nUR                  nUR	                  SU5        UR	                  SU5        UR                  S5      nUR                  S5      n/ n	UR                  S5      R                  U	R                  5      R                  U	R                  5        UR                  S5      R                  U	R                  5      R                  U	R                  5        / n
UR                  S5      R                  U
R                  5        UR                  S5      R                  U
R                  5        UR                  5         U R                  U
S   R                  S5        U R                  U
S   R                  S5        U R                  U
S   R                  S5        UR                  5         UR                  5         U R                  U
S   R                  S	5        U R                  [!        U	5      S5        U	S   S   nU R#                  UR%                  5       R&                  US
5        U R#                  UR)                  5       US5        / nUR                  SU5      R                  UR                  5        UR                  5         U R+                  US   5        U R                  UR-                  S5      UR-                  S5      5        UR.                  nU
S   R.                  nU R1                  XÒR2                  S5        A	AUR                  5         A
AUR                  5         [4        R6                  S:¼  a  [8        R:                  " 5         UR                  5         U R=                  XÒR2                  S5        U R=                  XÑR>                  S5        U R=                  XâR2                  S5        U R=                  XáR>                  S5        U RA                  URB                  S5        g )Nrþ  rL  ÚxxxÚgetCacher   r^   rý   rþ   r  zpotential refcounting issuez!other potential refcounting issueÚputCachezremote cache doesn't have itrD  zServer still had it after GCzClient still had it after GCz!Server still had complex after GCz!Client still had complex after GCzobserver was not removed)"r­   r.  rò   rõ   r  r  r  r¥  r@  Ú
addErrbackrX   r�  rÉ   rÊ   r   r  r,  ÚassertIdenticalr%  Ú__self__r)  r+  r  rE  rF  ÚremotelyCachedObjectsrH  rI  rJ  rK  rL  ÚlocallyCachedObjectsÚassertIsNoner  )r&   rõ   rk  rV   rL  Úobj2ÚvccÚo2Úo3ÚcollÚcomplexÚcpÚcol2rE  ÚbaroqueLuids                  r(   Ú
test_cacheÚBrokerTests.test_cache4  s  € Ü-°4Ñ8‰
ˆˆdÜ‹mˆÜ%Ó'ˆØ�f‰fˆØ	×Ñ˜% Ô%Ø	×Ñ˜% Ô&Ø�_‰_˜UÓ#ˆØ�_‰_˜UÓ#ˆØˆØ
�‰�jÓ!×-Ñ-¨d¯k©kÓ:×EÑEÀdÇkÁkÔRØ
�‰�jÓ!×-Ñ-¨d¯k©kÓ:×EÑEÀdÇkÁkÔRØˆØ
�‰�jÓ!×-Ñ-¨g¯n©nÔ=Ø
�‰�jÓ!×-Ñ-¨g¯n©nÔ=Ø�
‰
Œà×Ñ˜ ™Ÿ™ qÔ)Ø×Ñ˜ ™Ÿ™ qÔ)Ø×Ñ˜ ™Ÿ™¨Ô+à�‰ŒØ�
‰
ŒØ×Ñ˜ ™Ÿ™¨Ô+Ø×Ñœ˜T› AÔ&Ø�!‰W�Q‰ZˆØ×ÑØ�N‰NÓ×%Ñ% rÐ+Hô	
ð 	×Ñ˜RŸ\™\›^¨RÐ1TÔUØˆØ
�‰�j "Ó%×1Ñ1°$·+±+Ô>Ø�
‰
Œà�‰˜˜Q™Ô à×Ñ˜Ÿ™¨Ó4°b·o±oÀjÓ6QÔRð �w‰wˆØ˜a‘j—o‘oˆØ�‰�d×3Ñ3Ð5SÔTØØØ�
‰
ŒØØà�
‰
Œô �>‰>˜YÓ&Ü�JŠJŒLà�
‰
Œà×Ñ˜×6Ñ6Ð8VÔWØ×Ñ˜×5Ñ5Ð7UÔVØ×ÑØ×0Ñ0Ð2Uô	
ð 	×ÑØ×/Ñ/Ð1Tô	
ð 	×Ñ˜#Ÿ,™,Ð(BÕCr+   c                 ó”  •  [         R                  " S5        [        U S9u  pn[	        5       nUR                  SU5        UR                  S5      n/ nUR                  S5      R                  UR                  U R                  5        UR                  5         UR                  5       nU R                  UR                  S5        U R                  UR                  S5        U R                  UR                   S5        U R                  UR"                  S5        [        U S9u  pnUR                  SU5        UR                  S5      nUR                  S5      R                  UR                  U R                  5        UR                  5         UR                  5       nU R                  UR"                  S5        g ! [         a     GN®f = f)Nrä  rþ  r   ÚgetPubr^   r   )rå  ræ  rç  r­   ÚGetPublisherr  r  r  r[  r@  rí  rX   r“   r�  ÚactivateCalledÚisActivatedÚyayIGotPublishedÚ_wasCleanWhenLoaded)r&   rõ   rk  rV   r   r  ÚaccumrL  s           r(   Útest_publishableÚBrokerTests.test_publishablev  sh  € ð	Ü�IŠIÐ-Ô.ô .°4Ñ8‰
ˆˆdÜ‹nˆà	×Ñ˜% Ô%Ø�o‰o˜eÓ$ˆØˆØ�‰�xÓ ×-Ñ-¨e¯l©l¸D×<NÑ<NÔOØ�
‰
ŒØ�i‰i‹kˆØ×Ñ˜×+Ñ+¨QÔ/Ø×Ñ˜Ÿ™¨!Ô,Ø×Ñ˜×-Ñ-¨qÔ1à×Ñ˜×0Ñ0°!Ô4Ü-°4Ñ8‰
ˆˆdØ	×Ñ˜% Ô%Ø�o‰o˜eÓ$ˆØ�‰�xÓ ×-Ñ-¨e¯l©l¸D×<NÑ<NÔOØ�
‰
ŒØ�i‰i‹kˆà×Ñ˜×0Ñ0°!Õ4øô/ ó 	Úð	ús   ‚F9 Æ9
GÇGc                 ó&   • UR                   U l        g r5   )rØ   rð  )r&   Úvals     r(   ÚgotCopyÚBrokerTests.gotCopy’  s   € ØŸ6™6ˆÕr+   c                 óš  • [        U S9u  pnSn[        5       nUR                  SU5        UR                  S5      nUR	                  SU5      R                  U R                  U R                  5        UR                  5         UR                  5         UR                  5         U R                  U R                  USU R                   35        g )Nrþ  éc   r   Ú
getFactoryz!ID not correct on factory object )r­   rä   r  r  r  r[  rq  rû  rV   r�  rð  )r&   rõ   rk  rV   ÚIDrL  rÉ   s          r(   Útest_factoryCopyÚBrokerTests.test_factoryCopy•  s¥   € Ü-°4Ñ8‰
ˆˆdØˆÜ‹lˆØ	×Ñ˜% Ô%Ø�O‰O˜EÓ"ˆØ	�‰�\ 2Ó&×3Ñ3°D·L±LÀ$×BUÑBUÔVØ�	‰	ŒØ�	‰	ŒØ�	‰	ŒØ×ÑØ×ÑØØ/°×0@Ñ0@Ð/AÐBõ	
r+   )r  r"  rð  )r-   r.   r/   r0   rð  r—  rí  ró  r÷  rû  r  r  r#  r1  r5  r;  rA  rN  rc  rm  rq  rw  r1   r,   r+   r(   râ  râ  ‘  sb   † Ø€KòòDò"òò?òKò0ò(#òPò 
8ò8ò(=ò$0ò8@DòD5ò8"õ
r+   râ  sô  helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldc                  ó   • U q Uqg r5   )ÚcallbackArgsÚcallbackKeyword)Úargsrƒ  s     r(   ÚfinishedCallbackr}  ¬  s   € à€LØ�Or+   c                   ó    • \ rS rSrS rS rSrg)Ú	Pagerizeri²  c                 ó.   • XUsU l         U l        U l        g r5   )r”   r|  rƒ  )r&   r”   r|  rƒ  s       r(   rP   ÚPagerizer.__init__³  s   € Ø,4¸BÐ)ˆŒ�t”y $¥'r+   c                 óž   • [         R                  " U[        SU R                  /U R                  Q70 U R
                  D6  S =U l        U l        g )Néd   )r   ÚStringPagerÚ	bigStringr”   r|  rƒ  ©r&   Ú	collectors     r(   Úremote_getPagesÚPagerizer.remote_getPages¶  sE   € Ü×ÒØ”y # t§}¡}ð	
Ø7;·y±yò	
ØDHÇGÁGò	
ð #Ð"ˆŒ	�D•Gr+   )r|  r”   rƒ  N)r-   r.   r/   r0   rP   rˆ  r1   r,   r+   r(   r  r  ²  s   † ò?õ#r+   r  c                   ó$   • \ rS rSrSrS rS rSrg)ÚFilePagerizeri½  Nc                 ó:   • Xl         X#UsU l        U l        U l        g r5   )Úfilenamer”   r|  rƒ  )r&   r�  r”   r|  rƒ  s        r(   rP   ÚFilePagerizer.__init__À  s   € Ø ŒØ,4¸BÐ)ˆŒ�t”y $¥'r+   c                 óÆ   • [         R                  " U[        U R                  S5      U R                  /U R
                  Q70 U R                  D6U l        S =U l        U l        g )NÚrb)r   Ú	FilePagerÚopenr�  r”   r|  rƒ  Úpagerr†  s     r(   rˆ  ÚFilePagerizer.remote_getPagesÄ  sP   € Ü—^’^Ø”t˜DŸM™M¨4Ó0°$·-±-ð
ØBFÇ)Á)ò
ØOSÏwÉwñ
ˆŒ
ð #Ð"ˆŒ	�D•Gr+   )r|  r”   r�  rƒ  r“  )r-   r.   r/   r0   r“  rP   rˆ  r1   r,   r+   r(   r‹  r‹  ½  s   † Ø€Eò?õ#r+   r‹  c                   ó<   • \ rS rSrSrS rS rS rS rS r	S r
S	rg
)ÚPagingTestsiË  z(
Test pb objects sending data by pages.
c                 ó¸   • U R                  5       U l        [        U R                  S5       nUR                  [        5        SSS5        g! , (       d  f       g= f)z/
Create a file used to test L{util.FilePager}.
ÚwbN)Úmktempr�  r’  Úwriter…  )r&   Úfs     r(   r”  ÚPagingTests.setUpÐ  s9   € ð Ÿ™›ˆŒÜ�$—-‘- Ô&¨!Ø�G‰G”IÔ÷ '×&Ö&ús   ¬AÁ
Ac           	      óÒ  • [        U S9u  pnUR                  S[        [        SSS95        UR	                  S5      n/ n[
        R                  " US5      R                  UR                  5        U(       d  UR                  5         U(       d  M  U R                  SR                  US   5      [        S	5        U R                  [        S
S5        U R                  [        SS0S5        g)zO
Test L{util.StringPager}, passing a callback to fire when all pages
are sent.
rþ  r   Úhellor&  ©ré   ÚgetPagesr+   r   ú'Pages received not equal to pages sent!)rž  úCompleted callback not invokedré   N)r­   r  r  r}  r  r   ÚgetAllPagesr¥  r@  rV   r�  Újoinr…  rz  r{  ©r&   rõ   rk  rV   rÉ   r-  s         r(   Útest_pagingWithCallbackÚ#PagingTests.test_pagingWithCallbackØ  sÂ   € ô
 .°4Ñ8‰
ˆˆdØ	×Ñ˜%¤Ô+;¸WÈBÑ!OÔPØ�O‰O˜EÓ"ˆØˆÜ×Ò˜˜JÓ'×3Ñ3°A·H±HÔ=ÞØ�I‰IŒK÷ �!à×ÑØ�H‰H�Q�q‘T‹NœIÐ'Pô	
ð 	×Ñœ zÐ3SÔTØ×ÑÜ˜g r˜]Ð,Lõ	
r+   c                 ój  • [        U S9u  pnUR                  S[        S5      5        UR                  S5      n/ n[        R
                  " US5      R                  UR                  5        U(       d  UR                  5         U(       d  M  U R                  SR                  US   5      [        S5        g)z.
Test L{util.StringPager} without a callback.
rþ  r   Nr   r+   r   r¡  )r­   r  r  r  r   r£  r¥  r@  rV   r�  r¤  r…  r¥  s         r(   Útest_pagingWithoutCallbackÚ&PagingTests.test_pagingWithoutCallbackì  s�   € ô .°4Ñ8‰
ˆˆdØ	×Ñ˜%¤¨4£Ô1Ø�O‰O˜EÓ"ˆØˆÜ×Ò˜˜JÓ'×3Ñ3°A·H±HÔ=ÞØ�I‰IŒK÷ �!à×ÑØ�H‰H�Q�q‘T‹NœIÐ'Põ	
r+   c                 ó  • U R                  5       n[        US5      R                  5         [        U S9u  p#n[	        US5      nUR                  SU5        UR                  S5      n/ n[        R                  " US5      R                  UR                  5        SnU(       d*  US:”  a$  UR                  5         US-  nU(       d  US:”  a  M$  U(       d  U R                  S	5        U R                  S
R                  US   5      S
S5        g)z0
Test L{util.FilePager}, sending an empty file.
Úwrþ  Nr  r   r&  r   r^   zgetAllPages timed outr+   r¡  )r™  r’  Úcloser­   r‹  r  r  r   r£  r¥  r@  rV   rë  r�  r¤  )	r&   ÚfilenameEmptyrõ   rk  rV   Ú	pagerizerrÉ   r-  Úttls	            r(   Útest_emptyFilePagingÚ PagingTests.test_emptyFilePagingû  sÚ   € ð Ÿ™›ˆÜˆ]˜CÓ ×&Ñ&Ô(Ü-°4Ñ8‰
ˆˆdÜ! -°Ó6ˆ	Ø	×Ñ˜% Ô+Ø�O‰O˜EÓ"ˆØˆÜ×Ò˜˜JÓ'×3Ñ3°A·H±HÔ=ØˆÞ˜˜a›Ø�I‰IŒKØ�1‰HˆCö ˜˜a�ö Ø�I‰IÐ-Ô.Ø×Ñ˜Ÿ™ ! A¡$›¨Ð.WÕXr+   c                 ó8  • [        U S9u  pn[        U R                  [        SSS9nUR	                  SU5        UR                  S5      n/ n[        R                  " US5      R                  UR                  5        U(       d  UR                  5         U(       d  M  U R                  SR                  US   5      [        S	5        U R                  [        S
S5        U R                  [        SS0S5        U R                  UR                   R"                  / 5        g)z†
Test L{util.FilePager}, passing a callback to fire when all pages
are sent, and verify that the pager doesn't keep chunks in memory.
rþ  Úfrodoé	   rŸ  r  r   r+   r   r¡  )r´  r¢  ré   N)r­   r‹  r�  r}  r  r  r   r£  r¥  r@  rV   r�  r¤  r…  rz  r{  r“  Úchunks©r&   rõ   rk  rV   r¯  rÉ   r-  s          r(   Útest_filePagingWithCallbackÚ'PagingTests.test_filePagingWithCallback  sê   € ô
 .°4Ñ8‰
ˆˆdÜ! $§-¡-Ô1AÀ7ÐRSÑTˆ	Ø	×Ñ˜% Ô+Ø�O‰O˜EÓ"ˆØˆÜ×Ò˜˜JÓ'×3Ñ3°A·H±HÔ=ÞØ�I‰IŒK÷ �!à×ÑØ�H‰H�Q�q‘T‹NœIÐ'Pô	
ð 	×Ñœ zÐ3SÔTØ×ÑÜ˜g q˜\Ð+Kô	
ð 	×Ñ˜Ÿ™×/Ñ/°Õ4r+   c                 óÐ  • [        U S9u  pn[        U R                  S5      nUR                  SU5        UR	                  S5      n/ n[
        R                  " US5      R                  UR                  5        U(       d  UR                  5         U(       d  M  U R                  SR                  US   5      [        S5        U R                  UR                  R                  / 5        g)z,
Test L{util.FilePager} without a callback.
rþ  Nr  r   r+   r   r¡  )r­   r‹  r�  r  r  r   r£  r¥  r@  rV   r�  r¤  r…  r“  r¶  r·  s          r(   Útest_filePagingWithoutCallbackÚ*PagingTests.test_filePagingWithoutCallback%  sµ   € ô .°4Ñ8‰
ˆˆdÜ! $§-¡-°Ó6ˆ	Ø	×Ñ˜% Ô+Ø�O‰O˜EÓ"ˆØˆÜ×Ò˜˜JÓ'×3Ñ3°A·H±HÔ=ÞØ�I‰IŒK÷ �!à×ÑØ�H‰H�Q�q‘T‹NœIÐ'Pô	
ð 	×Ñ˜Ÿ™×/Ñ/°Õ4r+   )r�  N)r-   r.   r/   r0   r9   r”  r¦  r©  r±  r¸  r»  r1   r,   r+   r(   r–  r–  Ë  s&   † ñòò
ò(
òYò(5õ,5r+   r–  c                   ó   • \ rS rSrS rSrg)ÚDumbPublishablei7  c                 ó
   • SS0$ )Nrj  r^   r,   r6   s    r(   ÚgetStateToPublishÚ!DumbPublishable.getStateToPublish8  s   € Ø" AÐ&Ð&r+   r,   N)r-   r.   r/   r0   rÀ  r1   r,   r+   r(   r¾  r¾  7  s   † õ'r+   r¾  c                   ó   • \ rS rSrS rSrg)ÚDumbPubi<  c                 ó   • SU l         g r²   ©rh  r6   s    r(   Ú	activatedÚDumbPub.activated=  s
   € ØˆÕr+   rÅ  N)r-   r.   r/   r0   rÆ  r1   r,   r+   r(   rÃ  rÃ  <  s   † õ r+   rÃ  c                   ó    • \ rS rSrS rS rSrg)rg  iA  c                 ó$   • [        S5      U l        g )NÚTESTING)r¾  Úpubr6   s    r(   rP   ÚGetPublisher.__init__B  s   € Ü" 9Ó-ˆ�r+   c                 ó   • U R                   $ r5   ©rË  r6   s    r(   Úremote_getPubÚGetPublisher.remote_getPubE  s   € Ø�x‰xˆr+   rÎ  N)r-   r.   r/   r0   rP   rÏ  r1   r,   r+   r(   rg  rg  A  s   † ò.õr+   rg  c                   ó6   • \ rS rSrSrS rS rS rS rS r	Sr
g	)
ÚDisconnectionTestsiL  z
Test disconnection callbacks.
c                 ó   • [        SU 35      e)NzI shouldn't have been called: ©rÞ   )r&   r|  s     r(   rì  ÚDisconnectionTests.errorQ  s   € ÜÐ;¸D¸6ÐBÓCÐCr+   c                 ó   • SU l         g)z
Called on broker disconnect.
r^   N)ÚgotCallbackr6   s    r(   ÚgotDisconnectedÚ"DisconnectionTests.gotDisconnectedT  s   € ð ˆÕr+   c                 óH   • U R                  XR                  5        SU l        g)z'
Called on RemoteReference disconnect.
r^   N)r�  ÚremoteObjectÚobjectCallback©r&   Úos     r(   ÚobjectDisconnectedÚ%DisconnectionTests.objectDisconnectedZ  s    € ð 	×Ñ˜×-Ñ-Ô.ØˆÕr+   c                 óR  • [        U S9u  pnUR                  5         UR                  S[        5       5        UR	                  S5      n/ nUR                  S[        5       5      R                  UR                  5        UR                  5         U R                  [        U5      S5        g )Nrþ  rÞ  Ú
setBadCopyr^   )r­   rV   r  Ú
BadCopySetr  r  ÚBadCopyablerT  r@  rX   r�  r,  )r&   rõ   rk  rV   Úgr-  s         r(   Útest_badSerializationÚ(DisconnectionTests.test_badSerializationa  sz   € Ü-°4Ñ8‰
ˆˆdØ�	‰	ŒØ	×Ñ˜#œz›|Ô,Ø�O‰O˜CÓ ˆØˆØ	�‰�\¤;£=Ó1×<Ñ<¸Q¿X¹XÔFØ�
‰
ŒØ×Ñœ˜Q› Õ#r+   c                 óÜ  • [        U S9u  pnUR                  5         UR                  S[        5       5        UR	                  S5      nUR                  5         UR                  5         UR                  5         UR                  U R                  5        U R                  U R                  UR                  5        UR                  U R                  5        U R                  U R                  UR                  5        UR                  U R                  5        U R                  UR                  UR                  5        U R                  U R                  UR                  5        UR                  U R                  5        U R                  UR                  UR                  5        U R                  U R                  UR                  5        UR                  U R                  5        UR                  U R                  5        X@l        UR!                  ["        R$                  " [&        R(                  5      5        U R+                  U R,                  5        U R+                  U R.                  5        g )Nrþ  rÞ  )r­   rV   r  r¯   r  ÚnotifyOnDisconnectrì  rF  ÚdisconnectsÚdontNotifyOnDisconnectrL  Ú_disconnectedÚdisconnectCallbacksrØ  rß  rÛ  rm   r   rn   r   ro   r+  r×  rÜ  )r&   rõ   rk  rV   Úrs        r(   Útest_disconnectionÚ%DisconnectionTests.test_disconnectionk  s¡  € Ü-°4Ñ8‰
ˆˆdØ�	‰	ŒØ	×Ñ˜#œ|›~Ô.ð �O‰O˜CÓ ˆØ�	‰	ŒØ�	‰	ŒØ�	‰	Œð 	
×Ñ˜TŸZ™ZÔ(Ø�‰�d—j‘j !§-¡-Ô0Ø	× Ñ  §¡Ô,Ø×Ñ˜Ÿ™ Q§]¡]Ô3à	×Ñ˜TŸZ™ZÔ(Ø�‰�a—o‘o q§}¡}Ô5Ø�‰�d—j‘j !×"7Ñ"7Ô8Ø	× Ñ  §¡Ô,Ø×Ñ˜Ÿ™¨!¯-©-Ô8Ø×Ñ˜Ÿ™ Q×%:Ñ%:Ô;ð 	
×Ñ˜T×1Ñ1Ô2Ø	×Ñ˜T×4Ñ4Ô5ØÔð 	
×ÑœŸš¬×)=Ñ)=Ó>Ô?Ø�‰˜×(Ñ(Ô)Ø�‰˜×+Ñ+Õ,r+   )r×  rÜ  rÛ  N)r-   r.   r/   r0   r9   rì  rØ  rß  ræ  rï  r1   r,   r+   r(   rÒ  rÒ  L  s!   † ñòDòò ò$õ!-r+   rÒ  c                   ó   • \ rS rSrSrg)ÚFreakOuti�  r,   NrÒ   r,   r+   r(   rò  rò  �  rÓ   r+   rò  c                   ó   • \ rS rSrS rSrg)rä  i“  c                 ó   • [        5       er5   )rò  )r&   Úps     r(   ÚgetStateToCopyForÚBadCopyable.getStateToCopyFor”  s
   € Ü‹jÐr+   r,   N)r-   r.   r/   r0   rö  r1   r,   r+   r(   rä  rä  “  s   † õr+   rä  c                   ó   • \ rS rSrS rSrg)rã  i˜  c                 ó   • g r5   r,   )r&   Úbcs     r(   Úremote_setBadCopyÚBadCopySet.remote_setBadCopy™  s   € Ør+   r,   N)r-   r.   r/   r0   rû  r1   r,   r+   r(   rã  rã  ˜  s   † õr+   rã  c                   ó.   • \ rS rSrSrS rSS jrS rSrg)	ÚLocalRemoteTesti�  r   c                 ó   • US-   $ r²   r,   )r&   rÉ   s     r(   Ú	sync_add1ÚLocalRemoteTest.sync_add1   s   € Ø�1‰uˆr+   c                 ó
   • X-   $ r5   r,   )r&   rÉ   rÊ   s      r(   Ú	async_addÚLocalRemoteTest.async_add£  s	   € Ø‰uˆr+   c                 ó   • [        5       er5   rÔ  r6   s    r(   Ú
async_failÚLocalRemoteTest.async_fail¦  s
   € Ü‹nÐr+   r,   N)r   r^   )	r-   r.   r/   r0   ÚreportAllTracebacksr   r  r  r1   r,   r+   r(   rþ  rþ  �  s   † ØÐòôõr+   rþ  c                   ó>   • \ rS rSrSrS=rrS rS rS r	S r
S rS	rg
)ÚMyPerspectiveiª  z¯
@ivar loggedIn: set to C{True} when the avatar is logged in.
@type loggedIn: C{bool}

@ivar loggedOut: set to C{True} when the avatar is logged out.
@type loggedOut: C{bool}
Fc                 ó   • Xl         g r5   ©rB   ©r&   rB   s     r(   rP   ÚMyPerspective.__init__¶  s   € Ø �r+   c                 ó   • U R                   $ )zD
Return the avatar identifier which was used to access this avatar.
r  r6   s    r(   Úperspective_getAvatarIdÚ%MyPerspective.perspective_getAvatarId¹  s   € ð �}‰}Ðr+   c                 ó   • [        5       $ r5   )ÚMyViewr6   s    r(   Úperspective_getViewPointÚ&MyPerspective.perspective_getViewPoint¿  s	   € Ü‹xˆr+   c                 ó
   • X-   $ )z¸
Add the given objects and return the result.  This is a method
unavailable on L{Echoer}, so it can only be invoked by authenticated
users who received their avatar from L{TestRealm}.
r,   r  s      r(   Úperspective_addÚMyPerspective.perspective_addÂ  s   € ð ‰uˆr+   c                 ó   • SU l         g ©NT©Ú	loggedOutr6   s    r(   ÚlogoutÚMyPerspective.logoutÊ  ó	   € Øˆ�r+   )rB   r  N)r-   r.   r/   r0   r9   ÚloggedInr  rP   r  r  r  r  r1   r,   r+   r(   r
  r
  ª  s,   † ñð !Ð €Hˆyò!òòòõr+   r
  c                   ó&   • \ rS rSrSr\rSrS rSr	g)Ú	TestRealmiÎ  aš  
A realm which repeatedly gives out a single instance of L{MyPerspective}
for non-anonymous logins and which gives out a new instance of L{Echoer}
for each anonymous login.

@ivar lastPerspective: The L{MyPerspective} most recently created and
    returned from C{requestAvatar}.

@ivar perspectiveFactory: A one-argument callable which will be used to
    create avatars to be returned from C{requestAvatar}.
Nc                 óL  • U[         R                  :X  d   eUS:X  d   eU[        R                  L a  [         R                  [	        5       S 4$ U R                  U5      U l        SU R                  l        [         R                  U R                  U R                  R                  4$ )zÈ
Verify that the mind and interface supplied have the expected values
(this should really be done somewhere else, like inside a test method)
and return an avatar appropriate for the given identifier.
úBRAINS!c                  ó   • g r5   r,   r,   r+   r(   r?   Ú)TestRealm.requestAvatar.<locals>.<lambda>è  s   € °dr+   T)	r   rA   r   Ú	ANONYMOUSr|  ÚperspectiveFactoryÚlastPerspectiver   r  )r&   rB   rC   Ú	interfaces       r(   rF   ÚTestRealm.requestAvatarß  s‰   € ð œBŸO™OÓ+Ð+Ð+Ø�yÓ Ð Ð Ø”x×)Ñ)Ò)Ü—?‘?¤F£H©lÐ:Ð:à#'×#:Ñ#:¸8Ó#DˆDÔ Ø,0ˆD× Ñ Ô)Ü—O‘O T×%9Ñ%9¸4×;OÑ;O×;VÑ;VÐWÐWr+   )r)  )
r-   r.   r/   r0   r9   r
  r(  r)  rF   r1   r,   r+   r(   r"  r"  Î  s   † ñ
ð 'Ðà€OõXr+   r"  c                   ó   • \ rS rSrS rSrg)r  iï  c                 ó"   • [        U[        5      $ r5   )r#   r
  r%   s     r(   Ú
view_checkÚMyView.view_checkð  s   € Ü˜$¤Ó.Ð.r+   r,   N)r-   r.   r/   r0   r.  r1   r,   r+   r(   r  r  ï  s   † õ/r+   r  c                   ó$   • \ rS rSrSrS rS rSrg)Ú
LeakyRealmiô  zQ
A realm which hangs onto a reference to the mind object in its logout
function.
c                 ó   • Xl         g)zx
Create a L{LeakyRealm}.

@param mindEater: a callable that will be called with the C{mind}
object when it is available
N©Ú
_mindEater)r&   Ú	mindEaters     r(   rP   ÚLeakyRealm.__init__ú  s	   € ð $�r+   c                 óz   ^^• U R                  T5        U R                  U5      m[        R                  TUU4S j4$ )Nc                  ó(   >• T TR                  5       4$ r5   )r  )rC   Úpersps   €€r(   r?   Ú*LeakyRealm.requestAvatar.<locals>.<lambda>  s   ø€ °°u·|±|³~Ñ0Fr+   )r4  r(  r   rA   )r&   rB   rC   r*  r9  s     ` @r(   rF   ÚLeakyRealm.requestAvatar  s1   ù€ Ø�‰˜ÔØ×'Ñ'¨Ó1ˆÜ—‘ Õ(FÐGÐGr+   r3  N)r-   r.   r/   r0   r9   rP   rF   r1   r,   r+   r(   r1  r1  ô  s   † ñò
$õHr+   r1  c                   ó   • \ rS rSrSrS rSrg)ÚNewCredLeakTestsi	  z'
Tests to try to trigger memory leaks.
c                 ó¦  ^ ^^^	• ST l         U 4S jn[        T [        U5      S9u  nm	m/ mUR                  S5      nUR	                  SS5      nS nUR                  U5        UUU	4S jnUR                  U5        TR                  5         T R                  TS	/5        [        R                  " 5         T R                  T R                  5       5        g)
z›
The server does not leak a reference when the client disconnects
suddenly, even if the cred logout function forms a reference cycle with
the perspective.
Nc                 ó<   >• [         R                  " U 5      Tl        g r5   )Úweakrefr“  ÚmindRef)rC   r&   s    €r(   Ú
setMindRefÚ4NewCredLeakTests.test_logoutLeak.<locals>.setMindRef  s   ø€ Ü"Ÿ;š; tÓ,ˆD�Lr+   )r   r«   rÁ  Úloginr¥   c                 ón   • U u  p[        5       nUR                  S[        R                  " US5      U5      $ )NÚrespondr¥   )r¯   r  r   rF  )rÉ   Ú	challengeÚ
challengerrC   s       r(   Ú
cbResponseÚ4NewCredLeakTests.test_logoutLeak.<locals>.cbResponse$  s6   € Ø$%Ñ!ˆIÜ“>ˆDØ×(Ñ(Øœ2Ÿ:š: i°Ó:¸Dóð r+   c                 ó¤   >• TR                  5         TR                  S5        TR                  [        R                  " [        S5      5      5        g )Nr^   Úboom)r[   r@  rm   r   rn   rÞ   )Ú_ÚconnectionBrokenrV   rƒ   s    €€€r(   rm   Ú8NewCredLeakTests.test_logoutLeak.<locals>.connectionLost-  s6   ø€ Ø�I‰IŒKØ×#Ñ# AÔ&Ø×'Ñ'¬¯ª¼ÀVÓ8LÓ(MÕNr+   r^   )rA  r­   r1  r  r  r¥  rX   r�  rJ  rK  rY  )
r&   rB  r‚   rÁ  r\  rI  rm   rN  rV   rƒ   s
   `      @@@r(   Útest_logoutLeakÚ NewCredLeakTests.test_logoutLeak  s»   û€ ð ˆŒõ	-ô ,DØœZ¨
Ó3ñ,
Ñ(ˆ�l Dð
 ÐØ×)Ñ)¨&Ó1ˆØ�O‰O˜G XÓ.ˆò	ð 	
�‰�jÔ!÷	Oð
 	
�‰�nÔ%ð 	�
‰
ŒØ×ÑÐ)¨A¨3Ô/ô
 	�
Š
ŒØ×Ñ˜$Ÿ,™,›.Õ)r+   )rA  N)r-   r.   r/   r0   r9   rP  r1   r,   r+   r(   r=  r=  	  s   † ñõ.*r+   r=  c                   ó¼   • \ rS rSrSrS rSS jr\R                  " \	R                  5      4S jrS rS rS	 rS
 rS rS rS rS rS rS rS rS rS rS rSrg)ÚNewCredTestsi?  z5
Tests related to the L{twisted.cred} support in PB.
c                 óÔ   • [        5       U l        [        R                  " U R                  5      U l        [	        U R                  5      U l        [        R                  " 5       U l        g)z™
Create a portal with no checkers and wrap it around a simple test
realm.  Set up a PB server on a TCP port which serves perspectives
using that portal.
N)	r"  r«   r
   r©   r¾  r€   r   rª   rw   r6   s    r(   r”  ÚNewCredTests.setUpD  sC   € ô “[ˆŒ
Ü—m’m D§J¡JÓ/ˆŒÜ:¸4¿;¹;ÓGˆÔÜ×/Ò/Ó1ˆÕr+   Nc                 óP  • [        X R                  U R                  5      u  U l        U l        U l        [        5       U l        [        [        R                  " SSS5      U R                  5      U l        U R                  R                  5       R                  U R                  5        g)an  
Connect a client obtained from C{clientFactory} and a server
obtained from the current server factory via an L{IOPump},
then assign them to the appropriate instance variables

@ivar clientFactory: the broker client factory
@ivar clientFactory: L{pb.PBClientFactory} instance

@ivar client: the client broker
@type client: L{pb.Broker}

@ivar server: the server broker
@type server: L{pb.Broker}

@ivar pump: the IOPump connecting the client and server
@type pump: L{IOPump}

@ivar connector: A connector whose connect method recreates
    the above instance variables
@type connector: L{twisted.internet.base.IConnector}
ÚTCPrj   iá  N)r†   rw   r€   rL   rM   rV   rˆ   ÚconnectorStater˜   r   ÚIPv4Addressrt   r�   r¥  ÚestablishClientAndServer)r&   Ú_ignoreds     r(   rZ  Ú%NewCredTests.establishClientAndServerO  s…   € ô, /EØ×$Ñ$ d×&8Ñ&8ó/
Ñ+ˆŒ�T”[ $¤)ô >Ó?ˆÔÜ3Ü×Ò  {°DÓ9¸4×;NÑ;Nó
ˆŒð 	×Ñ×+Ñ+Ó-×9Ñ9¸$×:WÑ:WÕXr+   c                 óä   • U R                  U R                  R                  R                  5        U R                  R	                  U5        U R
                  R                  U R                  U5        g)aL  
Asserts that the client broker's transport was closed and then
mimics the event loop by calling the broker's connectionLost
callback with C{reason}, followed by C{self.clientFactory}'s
C{clientConnectionLost}

@param reason: (optional) the reason to pass to the client
    broker's connectionLost callback
@type reason: L{Failure}
N)r+  rL   rb   r*  rm   rw   rv   rt   )r&   ru   s     r(   ÚcompleteClientLostConnectionÚ)NewCredTests.completeClientLostConnectiono  sN   € ð 	�‰˜Ÿ™×-Ñ-×4Ñ4Ô5ð 	�‰×"Ñ" 6Ô*Ø×Ñ×/Ñ/°·±ÀÕGr+   c                 ó¸   ^ • T R                  5         T R                  R                  5       nU 4S jnU 4S jnUR                  U5        UR                  U5        U$ )z–
Assert that L{PBClientFactory.getRootObject}'s Deferred fires with
a L{RemoteReference}, and that disconnecting it runs its
disconnection callbacks.
c                 óH   >• TR                  U [        R                  5        U $ r5   )rœ  r   ÚRemoteReference)ÚrootObjr&   s    €r(   ÚgotRootObjectÚ6NewCredTests.test_getRootObject.<locals>.gotRootObjectŒ  s   ø€ Ø×!Ñ! '¬2×+=Ñ+=Ô>ØˆNr+   c                 ó¦   >• [        5       nU R                  UR                  5        TR                  R	                  5         TR                  5         U$ r5   )r   ré  r”   rw   Ú
disconnectr^  )rc  ÚdisconnectedDeferredr&   s     €r(   rg  Ú3NewCredTests.test_getRootObject.<locals>.disconnect�  sD   ø€ Ü#+£:Ð Ø×&Ñ&Ð';×'DÑ'DÔEØ×Ñ×)Ñ)Ô+à×-Ñ-Ô/à'Ð'r+   ©rZ  rw   r’  r¥  )r&   ÚrootObjDeferredrd  rg  s   `   r(   Útest_getRootObjectÚNewCredTests.test_getRootObjectƒ  sS   ø€ ð 	×%Ñ%Ô'Ø×,Ñ,×:Ñ:Ó<ˆõ	õ	(ð 	×#Ñ# MÔ2Ø×#Ñ# JÔ/àÐr+   c                 ó†   ^ • T R                  5         T R                  R                  5       nU 4S jnUR                  U5      $ )z{
Test that when a connection is lost, calling a method on a
RemoteReference obtained from it raises L{DeadReferenceError}.
c                 óØ   >^ • [        5       nT R                  UR                  5        U U4S jnUR                  U5        TR                  R                  5         TR                  5         U$ )Nc                 ó\   >• TR                  [        R                  TR                  S5        g )NÚmethod)ÚassertRaisesr   ÚDeadReferenceErrorr  )Úignrc  r&   s    €€r(   ÚlostConnectionÚSNewCredTests.test_deadReferenceError.<locals>.gotRootObject.<locals>.lostConnectionª  s!   ø€ Ø×!Ñ!¤"×"7Ñ"7¸×9KÑ9KÈXÕVr+   )r   ré  r”   r¥  rw   rg  r^  )rc  rh  ru  r&   s   `  €r(   rd  Ú;NewCredTests.test_deadReferenceError.<locals>.gotRootObject¦  sZ   ù€ Ü#+£:Ð Ø×&Ñ&Ð';×'DÑ'DÔEöWð !×,Ñ,¨^Ô<Ø×Ñ×)Ñ)Ô+à×-Ñ-Ô/à'Ð'r+   rj  )r&   rk  rd  s   `  r(   Útest_deadReferenceErrorÚ$NewCredTests.test_deadReferenceErrorž  s=   ø€ ð
 	×%Ñ%Ô'Ø×,Ñ,×:Ñ:Ó<ˆõ	(ð ×*Ñ*¨=Ó9Ð9r+   c                 óÐ   ^ •  " S S[         R                  5      nU" 5       T l        T R                  5         T R                  R	                  5       nU 4S jnUR                  U5      $ )z¢
Test that if the L{reconnecting} flag is passed with a True value then
a remote call made from a disconnection notification callback gets a
result successfully.
c                   ó   • \ rS rSrSrS rSrg)Ú=NewCredTests.test_clientConnectionLost.<locals>.ReconnectOncei½  Fc                 ó¤   • U R                   (       + nSU l         [        R                  R                  XX#5      nU(       a  UR	                  5         U$ r  )ÚreconnectedAlreadyr   rª   rv   r¡   )r&   rt   ru   Úreconnectingrò  s        r(   rv   ÚRNewCredTests.test_clientConnectionLost.<locals>.ReconnectOnce.clientConnectionLostÀ  sI   € Ø#'×#:Ñ#:Ô:�Ø*.�Ô'Ü×+Ñ+×@Ñ@Ø Vó�ö  Ø×%Ñ%Ô'Ø�r+   )r~  N)r-   r.   r/   r0   r~  rv   r1   r,   r+   r(   ÚReconnectOncer|  ½  s   † Ø!&Ðõr+   r�  c                 ó  >• TR                  U [        R                  5        [        5       nU R	                  UR
                  5        TR                  R                  5         TR                  5         U4S jnUR                  U5      $ )Nc                 óf   >• TR                   R                  5       nU4S jnUR                  U5      $ )Nc                 óæ   >• TR                  U [        R                  5        [        5       nU R	                  UR
                  5        TR                  R                  5         TR                  5         U$ r5   )	rœ  r   rb  r   ré  r”   rw   rg  r^  )ÚanotherRootObjr\  r&   s     €r(   ÚgotAnotherRootObjectÚqNewCredTests.test_clientConnectionLost.<locals>.gotRootObject.<locals>.disconnected.<locals>.gotAnotherRootObjectÛ  sU   ø€ Ø×)Ñ)¨.¼"×:LÑ:LÔMÜ ›
�AØ"×5Ñ5°a·j±jÔAØ×&Ñ&×1Ñ1Ô3Ø×5Ñ5Ô7Ø�Hr+   )rw   r’  r¥  )rt  r\  r†  r&   s      €r(   rl   ÚSNewCredTests.test_clientConnectionLost.<locals>.gotRootObject.<locals>.disconnectedØ  s.   ø€ Ø×&Ñ&×4Ñ4Ó6�õð —}‘}Ð%9Ó:Ð:r+   )
rœ  r   rb  r   ré  r”   rw   rg  r^  r¥  )rc  r\  rl   r&   s      €r(   rd  Ú=NewCredTests.test_clientConnectionLost.<locals>.gotRootObjectÏ  sf   ø€ Ø×!Ñ! '¬2×+=Ñ+=Ô>ä“
ˆAØ×&Ñ& q§z¡zÔ2à×Ñ×)Ñ)Ô+Ø×-Ñ-Ô/õ;ð —=‘= Ó.Ð.r+   )r   rª   rw   rZ  r’  r¥  )r&   r�  rk  rd  s   `   r(   Útest_clientConnectionLostÚ&NewCredTests.test_clientConnectionLost¶  sY   ø€ ô	œB×.Ñ.ô 	ñ +›_ˆÔØ×%Ñ%Ô'à×,Ñ,×:Ñ:Ó<ˆõ	/ð0 ×*Ñ*¨=Ó9Ð9r+   c                 ó  • U R                  5         U R                  R                  S5      nUR                  [        R
                  " [        5       5      5        UR                  [        R                  " [        R                  5      5        g)z|
Test that if a Broker loses its connection without receiving any bytes,
it doesn't raise any exceptions or log any errors.
)rj   i90  N)rZ  r€   rz   r|   r   r}   r{   rm   r   rn   r   ro   )r&   ÚserverProtos     r(   Útest_immediateCloseÚ NewCredTests.test_immediateCloseé  s_   € ð
 	×%Ñ%Ô'Ø×(Ñ(×6Ñ6Ð7KÓLˆØ×"Ñ"¤8×#7Ò#7¼»
Ó#CÔDØ×"Ñ"¤7§?¢?´4×3GÑ3GÓ#HÕIr+   c                 ó  • [         R                  " 5       nUR                  [        R                  " SS5      5      nUR                  S[        R                  " [        S5      5      5        U R                  U[        5      $ )z�
L{PBClientFactory.login} returns a L{Deferred} which is errbacked
with the L{ConnectionRefusedError} if the underlying connection is
refused.
ó   fooó   barNz!Test simulated refused connection)
r   rª   rD  r	   ÚUsernamePasswordÚclientConnectionFailedr   rn   r   ÚassertFailure)r&   rw   ÚloginDeferreds      r(   Útest_loginConnectionRefusedÚ(NewCredTests.test_loginConnectionRefusedó  sp   € ô ×*Ò*Ó,ˆØ%×+Ñ+Ü×(Ò(¨°Ó8ó
ˆð 	×,Ñ,ØÜ�OŠOÜ&Ð'JÓKóô	
ð ×!Ñ! -Ô1GÓHÐHr+   c                 ó@  ^ ^• T R                   R                  [        R                  " SS95        [        R
                  " SS5      nSn[        5       mT R                  R                  X5      nUU 4S jnU 4S jnUR                  U5        UR                  U5        U 4S jnUR                  U5        T R                  5         T R                  R                  5         [        R                  " 5         T R                  R                  5         TR                  S5        U$ )	z‡
Test that login can be performed with IUsernamePassword credentials and
that when the connection is dropped the avatar is logged out.
ó   pass©r'   ó   userr$  c                 ó¦   >• TR                  TR                  R                  R                  5        TR	                  U [
        R                  5        T$ r5   )r+  r«   r)  r   rœ  r   rb  )r
  ÚloginCompletedr&   s    €€r(   ÚcbLoginÚ.NewCredTests.test_loginLogout.<locals>.cbLogin  s;   ø€ Ø�O‰O˜DŸJ™J×6Ñ6×?Ñ?Ô@Ø×!Ñ! +¬r×/AÑ/AÔBØ!Ð!r+   c                 óZ   >• TR                   R                  5         TR                  5         g r5   )rw   rg  r^  ©Úignoredr&   s    €r(   ÚcbDisconnectÚ3NewCredTests.test_loginLogout.<locals>.cbDisconnect  s!   ø€ Ø×Ñ×)Ñ)Ô+Ø×-Ñ-Õ/r+   c                 ód   >• TR                  TR                  R                  R                  5        g r5   )r+  r«   r)  r  r¢  s    €r(   ÚcbLogoutÚ/NewCredTests.test_loginLogout.<locals>.cbLogout&  s   ø€ Ø�O‰O˜DŸJ™J×6Ñ6×@Ñ@ÕAr+   N)r
   ÚregisterCheckerr   r§   r	   r“  r   rw   rD  r¥  rZ  rV   rX   rJ  rK  r”   )r&   ÚcredsrC   r\  rŸ  r¤  r§  rž  s   `      @r(   Útest_loginLogoutÚNewCredTests.test_loginLogout  sÛ   ù€ ð
 	�‰×#Ñ#Ü×<Ò<À'ÑJô	
ô ×,Ò,¨W°gÓ>ˆð ˆä!›ˆà×Ñ×$Ñ$ UÓ1ˆö	"õ
	0ð 	
�‰�gÔØ	�‰�lÔ#õ	Bð 	
�‰�hÔà×%Ñ%Ô'Ø�	‰	�‰Ôô 	�
Š
Œà�	‰	�‰Ôà×Ñ Ô%Øˆr+   c                 óB  ^ ^• [        5       m " U4S jS[        R                  5      nUT R                  l        T R
                  R                  [        R                  " SS95        T R                  R                  [        R                  " SS5      S5      nU4S jnUR                  U5        U 4S jnUR                  U5        T R                  5         T R                  R!                  5         ["        R$                  " 5         T R                  R!                  5         U$ )	zÂ
If a L{RemoteReference} to an L{IPerspective} avatar is decrefed and
there remain no other references to the avatar on the server, the
avatar is garbage collected and the logout method called.
c                   ó,   >• \ rS rSrSrS rU 4S jrSrg)Ú=NewCredTests.test_logoutAfterDecref.<locals>.EventPerspectivei>  z9
An avatar which fires a Deferred when it is logged out.
c                 ó   • g r5   r,   r  s     r(   rP   ÚFNewCredTests.test_logoutAfterDecref.<locals>.EventPerspective.__init__C  s   € Ør+   c                 ó(   >• TR                  S 5        g r5   )r”   )r&   r  s    €r(   r  ÚDNewCredTests.test_logoutAfterDecref.<locals>.EventPerspective.logoutF  s   ø€ Ø×"Ñ" 4Õ(r+   r,   N)r-   r.   r/   r0   r9   rP   r  r1   r  s   €r(   ÚEventPerspectiver¯  >  s   ø† ñò÷)ð )r+   r´  r’  r  r‘  r$  c                 ó   >• T$ r5   r,   )Úavatarr  s    €r(   Ú
cbLoggedInÚ7NewCredTests.test_logoutAfterDecref.<locals>.cbLoggedInS  s   ø€ ð Ðr+   c                 óf   >• TR                  TR                  R                  R                  0 5        g r5   )r�  r€   rÄ  Ú_localCleanupr¢  s    €r(   ÚcbLoggedOutÚ8NewCredTests.test_logoutAfterDecref.<locals>.cbLoggedOutZ  s(   ø€ ð ×Ñ˜T×/Ñ/×@Ñ@×NÑNÐPRÕSr+   )r   r   ÚAvatarr«   r(  r
   r©  r   r§   rw   rD  r	   r“  r¥  rZ  rV   rX   rJ  rK  )r&   r´  r\  r·  r»  r  s   `    @r(   Útest_logoutAfterDecrefÚ#NewCredTests.test_logoutAfterDecref6  sÕ   ù€ ô “Jˆ	÷		)œrŸy™yô 		)ð )9ˆ�
‰
Ô%à�‰×#Ñ#Ü×<Ò<ÀÑHô	
ð ×Ñ×$Ñ$Ü×(Ò(¨°Ó8¸)ó
ˆõ	ð
 	
�‰�jÔ!õ	Tð
 	
�‰�kÔ"à×%Ñ%Ô'ð 	�	‰	�‰Ôô 	�
Š
Œà�	‰	�‰ÔØˆr+   c                 óê  ^ • T R                   R                  [        R                  " SSS95        T R                  R                  [        R                  " SS5      S5      nT R                  R                  [        R                  " SS5      S5      n[        X/5      nS nUR                  U5        U 4S jnUR                  U5        T R                  5         T R                  R                  5         U$ )	zˆ
Two different correct login attempts can be made on the same root
object at the same time and produce two different resulting avatars.
r’  s   quux)r   Úbazr‘  r$  ó   bazc                 ó`   • U u  p[        UR                  S5      UR                  S5      /5      $ )NÚgetAvatarId)r   r  )rò  ÚfirstÚseconds      r(   r·  Ú5NewCredTests.test_concurrentLogin.<locals>.cbLoggedIn}  s4   € Ø$‰OˆUÜ Ø×!Ñ! -Ó0°&×2CÑ2CÀMÓ2RÐSóð r+   c                 óV   >• U u  pTR                  US5        TR                  US5        g )Nr‘  rÂ  )r�  )rÉ   rÅ  rÆ  r&   s      €r(   ÚcbAvatarIdsÚ6NewCredTests.test_concurrentLogin.<locals>.cbAvatarIds…  s*   ø€ Ø‰MˆEØ×Ñ˜U FÔ+Ø×Ñ˜V VÕ,r+   )r
   r©  r   r§   rw   rD  r	   r“  r   r¥  rZ  rV   rX   )r&   Ú
firstLoginÚsecondLoginr\  r·  rÉ  s   `     r(   Útest_concurrentLoginÚ!NewCredTests.test_concurrentLoginl  sÏ   ø€ ð
 	�‰×#Ñ#Ü×<Ò<ÀÈWÑUô	
ð ×'Ñ'×-Ñ-Ü×(Ò(¨°Ó8¸)ó
ˆ
ð ×(Ñ(×.Ñ.Ü×(Ò(¨°Ó9¸9ó
ˆô ˜:Ð3Ó4ˆò	ð 	
�‰�jÔ!õ	-ð
 	
�‰�kÔ"à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr+   c                 ó  ^ • T R                   R                  [        R                  " SS95        T R                  R                  [        R                  " SS5      5      nT R                  R                  [        R                  " SS5      5      nT R                  U[        5        T R                  U[        5        [        X/5      nU 4S jnUR                  U5        T R                  5         T R                  R                  5         U$ )zb
Test that a login attempt with an invalid user or invalid password
fails in the appropriate way.
rš  r›  s
   nosuchuserrœ  s	   wrongpassc                 óf   >• TR                  [        5      nTR                  [        U5      S5        g )Nrý   )ÚflushLoggedErrorsr   r�  r,  ©ÚignoreÚerrorsr&   s     €r(   ÚcleanupÚ;NewCredTests.test_badUsernamePasswordLogin.<locals>.cleanup¥  s(   ø€ Ø×+Ñ+Ô,=Ó>ˆFØ×ÑœS ›[¨!Õ,r+   )r
   r©  r   r§   rw   rD  r	   r“  r•  r   r   r¥  rZ  rV   rX   )r&   rË  rÌ  r\  rÕ  s   `    r(   Útest_badUsernamePasswordLoginÚ*NewCredTests.test_badUsernamePasswordLogin‘  sØ   ø€ ð
 	�‰×#Ñ#Ü×<Ò<À'ÑJô	
ð ×'Ñ'×-Ñ-Ü×(Ò(¨¸Ó@ó
ˆ
ð ×(Ñ(×.Ñ.Ü×(Ò(¨°,Ó?ó
ˆð 	×Ñ˜:Ô'8Ô9Ø×Ñ˜;Ô(9Ô:Ü˜:Ð3Ó4ˆõ	-ð 	
�‰�gÔà×%Ñ%Ô'Ø�	‰	�‰Ôàˆr+   c                 ót  • U R                   R                  [        R                  " 5       5        U R                  R                  [        R                  " 5       S5      nS nUR                  U5        UR                  U R                  S5        U R                  5         U R                  R                  5         U$ )z—
Verify that a PB server using a portal configured with a checker which
allows IAnonymous credentials can be logged into using IAnonymous
credentials.
r$  c                 ó&   • U R                  SS5      $ ©Nrš  é{   r  ©r
  s    r(   r·  Ú4NewCredTests.test_anonymousLogin.<locals>.cbLoggedIn¹  ó   € Ø×)Ñ)¨&°#Ó6Ð6r+   rÜ  )r
   r©  r   ÚAllowAnonymousAccessrw   rD  r	   Ú	Anonymousr¥  r�  rZ  rV   rX   )r&   r\  r·  s      r(   Útest_anonymousLoginÚ NewCredTests.test_anonymousLogin°  s†   € ð 	�‰×#Ñ#¤H×$AÒ$AÓ$CÔDØ×Ñ×$Ñ$¤[×%:Ò%:Ó%<¸iÓHˆò	7ð 	
�‰�jÔ!à	�‰�d×&Ñ&¨Ô,à×%Ñ%Ô'Ø�	‰	�‰ÔØˆr+   c                 ón  ^ • T R                   R                  [        R                  " SS95        T R                  R                  [        R                  " 5       S5      nT R                  U[        5        U 4S jnUR                  U5        T R                  5         T R                  R                  5         U$ )zO
Verify that without an anonymous checker set up, anonymous login is
rejected.
Úpassr›  r$  c                 óf   >• TR                  [        5      nTR                  [        U5      S5        g r²   )rÑ  r   r�  r,  rÒ  s     €r(   rÕ  Ú=NewCredTests.test_anonymousLoginNotPermitted.<locals>.cleanupÏ  s(   ø€ Ø×+Ñ+Ô,@ÓAˆFØ×ÑœS ›[¨!Õ,r+   )r
   r©  r   r§   rw   rD  r	   rá  r•  r   r¥  rZ  rV   rX   )r&   r\  rÕ  s   `  r(   Útest_anonymousLoginNotPermittedÚ,NewCredTests.test_anonymousLoginNotPermittedÄ  s‹   ø€ ð
 	�‰×#Ñ#Ü×<Ò<À&ÑIô	
ð ×Ñ×$Ñ$¤[×%:Ò%:Ó%<¸iÓHˆØ×Ñ˜1Ô2Ô3õ	-ð 	
�‰�gÔà×%Ñ%Ô'Ø�	‰	�‰Ôàˆr+   c                 óÎ  • U R                   R                  [        R                  " 5       5        U R                   R                  [        R                  " SS95        U R
                  R                  [        R                  " 5       S5      nS nUR                  U5        UR                  U R                  S5        U R                  5         U R                  R                  5         U$ )zl
Like L{test_anonymousLogin} but against a portal with a checker for
both IAnonymous and IUsernamePassword.
rš  r›  r$  c                 ó&   • U R                  SS5      $ rÛ  r  rÝ  s    r(   rŸ  ÚENewCredTests.test_anonymousLoginWithMultipleCheckers.<locals>.cbLoginå  rß  r+   rÜ  )r
   r©  r   rà  r§   rw   rD  r	   rá  r¥  r�  rZ  rV   rX   ©r&   r\  rŸ  s      r(   Ú'test_anonymousLoginWithMultipleCheckersÚ4NewCredTests.test_anonymousLoginWithMultipleCheckersÚ  s¨   € ð
 	�‰×#Ñ#¤H×$AÒ$AÓ$CÔDØ�‰×#Ñ#Ü×<Ò<À'ÑJô	
ð ×Ñ×$Ñ$¤[×%:Ò%:Ó%<¸iÓHˆò	7ð 	
�‰�gÔà	�‰�d×&Ñ&¨Ô,à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr+   c                 óÒ  • U R                   R                  [        R                  " 5       5        U R                   R                  [        R                  " SS95        U R
                  R                  [        R                  " SS5      S5      nS nUR                  U5        UR                  U R                  S5        U R                  5         U R                  R                  5         U$ )zh
Like L{test_anonymousLoginWithMultipleCheckers} but check that
username/password authentication works.
rš  r›  rœ  r$  c                 ó(   • U R                  SSS5      $ )NÚaddrƒ  é   r  rÝ  s    r(   rŸ  ÚINewCredTests.test_authenticatedLoginWithMultipleCheckers.<locals>.cbLoginþ  s   € Ø×)Ñ)¨%°°bÓ9Ð9r+   rÜ  )r
   r©  r   rà  r§   rw   rD  r	   r“  r¥  r�  rZ  rV   rX   rí  s      r(   Ú+test_authenticatedLoginWithMultipleCheckersÚ8NewCredTests.test_authenticatedLoginWithMultipleCheckersñ  s¯   € ð
 	�‰×#Ñ#¤H×$AÒ$AÓ$CÔDØ�‰×#Ñ#Ü×<Ò<À'ÑJô	
ð ×Ñ×$Ñ$Ü×(Ò(¨°'Ó:¸Ió
ˆò	:ð 	
�‰�gÔà	�‰�d×&Ñ&¨Ô,à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr+   c                 óœ  • U R                   R                  [        R                  " SS95        U R                  R                  [        R                  " SS5      S5      nS nUR                  U5        S nUR                  U5        UR                  U R                  5        U R                  5         U R                  R                  5         U$ )zJ
Verify that a viewpoint can be retrieved after authenticating with
cred.
rš  r›  rœ  r$  c                 ó$   • U R                  S5      $ )NÚgetViewPointr  rÝ  s    r(   rŸ  Ú'NewCredTests.test_view.<locals>.cbLogin  s   € Ø×)Ñ)¨.Ó9Ð9r+   c                 ó$   • U R                  S5      $ )Nr$  r  )Ú	viewpoints    r(   ÚcbViewÚ&NewCredTests.test_view.<locals>.cbView  s   € Ø×'Ñ'¨Ó0Ð0r+   )r
   r©  r   r§   rw   rD  r	   r“  r¥  r+  rZ  rV   rX   )r&   r\  rŸ  rý  s       r(   Ú	test_viewÚNewCredTests.test_view
  s£   € ð
 	�‰×#Ñ#Ü×<Ò<À'ÑJô	
ð ×Ñ×$Ñ$Ü×(Ò(¨°'Ó:¸Ió
ˆò	:ð 	
�‰�gÔò	1ð 	
�‰�fÔà	�‰�d—o‘oÔ&à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr+   )	rL   rw   rt   rX  r
   rV   r«   rM   r€   r5   )r-   r.   r/   r0   r9   r”  rZ  r   rn   r   ro   r^  rl  rx  rŠ  rŽ  r—  r«  r¾  rÍ  r×  râ  rè  rî  rõ  rÿ  r1   r,   r+   r(   rS  rS  ?  sy   † ñò	2ôYðB —_’_ T×%9Ñ%9Ó:ôHò(ò6:ò01:òfJòIò$/òb4òl#òJò>ò(ò,ò.õ2r+   rS  c                   ó&   • \ rS rSrS rS rS rSrg)ÚNonSubclassingPerspectivei(  c                 ó   • g r5   r,   r  s     r(   rP   Ú"NonSubclassingPerspective.__init__*  rù  r+   c                 ól   • UR                  X05      nUR                  X@5      nUR                  X#U45      $ r5   )ÚunserializeÚ	serialize)r&   rp   Úmessager|  Úkwargss        r(   ÚperspectiveMessageReceivedÚ4NonSubclassingPerspective.perspectiveMessageReceived.  s8   € Ø×!Ñ! $Ó-ˆØ×#Ñ# FÓ1ˆØ×Ñ °Ð 7Ó8Ð8r+   c                 ó   • SU l         g r  r  r6   s    r(   r  Ú NonSubclassingPerspective.logout4  r  r+   r  N)r-   r.   r/   r0   rP   r
  r  r1   r,   r+   r(   r  r  (  s   † òò9õr+   r  c                   ó$   • \ rS rSrSrS rS rSrg)ÚNSPTestsi8  zs
Tests for authentication against a realm where the L{IPerspective}
implementation is not a subclass of L{Avatar}.
c                 óŽ  • [        5       U l        [        U R                  l        [        R
                  " U R                  5      U l        [        R                  " 5       U l        U R                  R                  SS5        U R                  R                  U R                  5        [        [        R                  " U R                  5      5      U l        [        R                   " SU R                  SS9U l        U R%                  U R"                  R&                  5        U R"                  R)                  5       R"                  U l        g )Nrœ  rš  r   rj   )r*  )r"  r«   r  r(  r
   r©   r   r§   r¬   ÚaddUserr©  r   r   r¨   rÒ  r   rÎ  rÑ  r~   rØ  rÐ  Úportnor6   s    r(   r”  ÚNSPTests.setUp>  sÊ   € Ü“[ˆŒ
Ü(Aˆ�
‰
Ô%Ü—m’m D§J¡JÓ/ˆŒÜ×GÒGÓIˆŒØ�‰×Ñ˜W gÔ.Ø�‰×#Ñ# D§L¡LÔ1Ü&¤r×'9Ò'9¸$¿+¹+Ó'FÓGˆŒÜ×%Ò% a¨¯©ÀÑMˆŒ	Ø�‰˜Ÿ	™	×/Ñ/Ô0Ø—i‘i×'Ñ'Ó)×.Ñ.ˆ�r+   c                 ó\  ^ ^• [         R                  " 5       mTR                  [        R                  " SS5      S5      n[
        R                  " ST R                  T5        UR                  S 5        UR                  T R                  SSSS	045        UU 4S
 jnUR                  U5        U$ )zw
An L{IPerspective} implementation which does not subclass
L{Avatar} can expose remote methods for the client to call.
rœ  rš  r$  rj   c                 ó$   • U R                  SSSS9$ )NÚANYTHINGÚhererÁ  )r  r  )rõ  s    r(   r?   Ú#NSPTests.test_NSP.<locals>.<lambda>R  s   €  §¡¨Z¸ÀU Ñ Kr+   r  )r  r  rÁ  c                 ó”   >• TR                  5         TR                  R                   H  nUR                  R	                  5         M     g r5   )rg  rÒ  Ú	protocolsrb   r×  )r£  rõ  rÒ  r&   s     €€r(   rÕ  Ú"NSPTests.test_NSP.<locals>.cleanupU  s3   ø€ Ø×ÑÔ Ø—\‘\×+Ô+�Ø—‘×*Ñ*Ö,ò ,r+   )
r   rª   rD  r	   r“  r   rÏ  r  r¥  r�  )r&   r\  rÕ  rÒ  s   `  @r(   Útest_NSPÚNSPTests.test_NSPJ  sŠ   ù€ ô
 ×$Ò$Ó&ˆØ�M‰Mœ+×6Ò6°wÀÓHÈ)ÓTˆÜ×Ò˜;¨¯©°WÔ=Ø	�‰ÑKÔLØ	�‰�d×&Ñ&¨°YÀÈÀÐ(OÔPö	-ð
 	
�‰�gÔØˆr+   )r¬   rÒ  rÑ  r
   r  r«   N)r-   r.   r/   r0   r9   r”  r  r1   r,   r+   r(   r  r  8  s   † ñò

/õr+   r  c                   ó$   • \ rS rSrSrS rS rSrg)Ú
IForwardedi^  z9
Interface used for testing L{util.LocalAsyncForwarder}.
c                  ó   • g)z
Simple synchronous method.
Nr,   r,   r+   r(   Ú	forwardMeÚIForwarded.forwardMec  ó   � r+   c                  ó   • g)z
Simple asynchronous method.
Nr,   r,   r+   r(   ÚforwardDeferredÚIForwarded.forwardDeferredh  r#  r+   r,   N)r-   r.   r/   r0   r9   r!  r%  r1   r,   r+   r(   r  r  ^  s   † ñòõ
r+   r  c                   ó2   • \ rS rSrSrSrSrS rS rS r	Sr
g)	Ú	Forwardedin  zÂ
Test implementation of L{IForwarded}.

@ivar forwarded: set if C{forwardMe} is called.
@type forwarded: C{bool}
@ivar unforwarded: set if C{dontForwardMe} is called.
@type unforwarded: C{bool}
Fc                 ó   • SU l         g)z&
Set a local flag to test afterwards.
TN)Ú	forwardedr6   s    r(   r!  ÚForwarded.forwardMe|  s   € ð ˆ�r+   c                 ó   • SU l         g)z^
Set a local flag to test afterwards. This should not be called as it's
not in the interface.
TN)Úunforwardedr6   s    r(   ÚdontForwardMeÚForwarded.dontForwardMe‚  s   € ð
  ˆÕr+   c                 ó   • [        S5      $ )z 
Asynchronously return C{True}.
T)r   r6   s    r(   r%  ÚForwarded.forwardDeferred‰  s   € ô �t‹}Ðr+   )r*  r-  N)r-   r.   r/   r0   r9   r*  r-  r!  r.  r%  r1   r,   r+   r(   r(  r(  n  s"   † ñð €IØ€Kòò õr+   r(  c                   ó6   • \ rS rSrSrS rS rS rS rS r	Sr
g	)
ÚSpreadUtilTestsi�  z#
Tests for L{twisted.spread.util}.
c                 ó\   • [        5       nU R                  UR                  SS5      S5        g)zS
Call a synchronous method of a L{util.LocalAsRemote} object and check
the result.
Úadd1rý   rþ   N)rþ  r�  r  rÝ  s     r(   Ú	test_syncÚSpreadUtilTests.test_sync•  s'   € ô
 ÓˆØ×Ñ˜Ÿ™ f¨aÓ0°!Õ4r+   c                 ó´   • [        5       n[        5       nUR                  SSSS9nU R                  U[        5        UR	                  U R
                  S5        U$ )zU
Call an asynchronous method of a L{util.LocalAsRemote} object and check
the result.
rò  rý   r  )rÊ   r?  )rþ  r  rœ  r   r¥  r�  )r&   rÞ  r\  s      r(   Ú
test_asyncÚSpreadUtilTests.test_async�  sQ   € ô
 ÓˆÜÓˆØ�L‰L˜  QˆLÐ'ˆØ×Ñ˜a¤Ô*Ø	�‰�d×&Ñ&¨Ô*Øˆr+   c                 óv   ^ • [        5       nUR                  S5      nU 4S jnUR                  U 4S jU5        U$ )z7
Test an asynchronous failure on a remote method call.
rë  c                 óp   >• TR                  U [        R                  5        U R                  [        5        g r5   )rœ  r   rn   ÚtraprÞ   )r›  r&   s    €r(   ÚebÚ*SpreadUtilTests.test_asyncFail.<locals>.eb°  s#   ø€ Ø×!Ñ! !¤W§_¡_Ô5Ø�F‰F”<Õ r+   c                 ó&   >• TR                  S5      $ )Nzsupposed to failrê  )r   r&   s    €r(   r?   Ú0SpreadUtilTests.test_asyncFail.<locals>.<lambda>´  s   ø€  4§9¡9Ð-?Ô#@r+   )rþ  r  r[  )r&   rÞ  r\  r>  s   `   r(   Útest_asyncFailÚSpreadUtilTests.test_asyncFail©  s6   ø€ ô ÓˆØ�L‰L˜Ó ˆõ	!ð 	
�‰Ô@À"ÔEØˆr+   c                 ój   • [        5       nUR                  S5      nU R                  U" S5      S5        g)z=
Test the C{remoteMethod} facility of L{util.LocalAsRemote}.
r5  rþ   r  N)rþ  r  r�  )r&   rÞ  Úms      r(   Útest_remoteMethodÚ!SpreadUtilTests.test_remoteMethod·  s.   € ô ÓˆØ�N‰N˜6Ó"ˆØ×Ñ™˜1›˜qÕ!r+   c                 ó„  • [        5       n[        R                  " U[        5      nUR	                  S5        U R                  UR                  5        UR	                  S5        U R                  UR                  5        UR	                  S5      n/ nUR                  UR                  5        U R                  US   S5        g)zM
Test a call to L{util.LocalAsyncForwarder} using L{Forwarded} local
object.
r!  r.  r%  r   r^   N)r(  r   ÚLocalAsyncForwarderr  r  r+  r*  rž  r-  r¥  r@  r�  )r&   r›  ÚlfÚrrr-  s        r(   Útest_localAsyncForwarderÚ(SpreadUtilTests.test_localAsyncForwarder¿  s�   € ô
 ‹KˆÜ×%Ò% a¬Ó4ˆØ
�‰�kÔ"Ø�‰˜Ÿ™Ô$Ø
�‰�oÔ&Ø×Ñ˜Ÿ™Ô'Ø�]‰]Ð,Ó-ˆØˆØ
�‰�q—x‘xÔ Ø×Ñ˜˜1™˜qÕ!r+   r,   N)r-   r.   r/   r0   r9   r6  r9  rB  rF  rL  r1   r,   r+   r(   r3  r3  �  s    † ñò5ò
òò"õ"r+   r3  c                   ó0   • \ rS rSrSrS rS rS rS rSr	g)	ÚPBWithSecurityOptionsTestsiÐ  z
Test security customization.
c                 ó¤   • [         R                  " 5       nUR                  S5      nU R                  UR                  [
        R                  5        g)zT
By default, client broker should use C{jelly.globalSecurity} as
security settings.
N)r   rª   rz   r  Úsecurityr   ÚglobalSecurity©r&   rÒ  rp   s      r(   Ú!test_clientDefaultSecurityOptionsÚ<PBWithSecurityOptionsTests.test_clientDefaultSecurityOptionsÕ  s:   € ô
 ×$Ò$Ó&ˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o¤u×';Ñ';Õ<r+   c                 ó¶   • [         R                  " [        5       5      nUR                  S5      nU R	                  UR
                  [        R                  5        g)zT
By default, server broker should use C{jelly.globalSecurity} as
security settings.
N)r   r¨   r|  rz   r  rQ  r   rR  rS  s      r(   Ú!test_serverDefaultSecurityOptionsÚ<PBWithSecurityOptionsTests.test_serverDefaultSecurityOptionsÞ  s>   € ô
 ×$Ò$¤V£XÓ.ˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o¤u×';Ñ';Õ<r+   c                 ó°   • [         R                  " 5       n[        R                  " US9nUR	                  S5      nU R                  UR                  U5        g)z[
Check that the security settings are passed from the client factory to
the broker object.
©rQ  N)r   ÚSecurityOptionsr   rª   rz   r  rQ  ©r&   rQ  rÒ  rp   s       r(   Ú test_clientSecurityCustomizationÚ;PBWithSecurityOptionsTests.test_clientSecurityCustomizationç  sD   € ô
 ×(Ò(Ó*ˆÜ×$Ò$¨hÑ7ˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o xÕ0r+   c                 óÂ   • [         R                  " 5       n[        R                  " [	        5       US9nUR                  S5      nU R                  UR                  U5        g)z[
Check that the security settings are passed from the server factory to
the broker object.
rZ  N)r   r[  r   r¨   r|  rz   r  rQ  r\  s       r(   Ú test_serverSecurityCustomizationÚ;PBWithSecurityOptionsTests.test_serverSecurityCustomizationñ  sH   € ô
 ×(Ò(Ó*ˆÜ×$Ò$¤V£X¸ÑAˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o xÕ0r+   r,   N)
r-   r.   r/   r0   r9   rT  rW  r]  r`  r1   r,   r+   r(   rO  rO  Ð  s   † ñò=ò=ò1õ1r+   rO  r5   )�r9   rJ  rå  rH  rU   r@  Úcollectionsr   Úior   r{   Útypingr   Úzope.interfacer   r   Útwisted.credr   r	   r
   Útwisted.cred.errorr   r   Útwisted.internetr   r   r   r   Útwisted.internet.deferr   r   r   Útwisted.internet.errorr   Útwisted.internet.testingr   Útwisted.protocols.policiesr   Útwisted.pythonr   r   Útwisted.python.compatr   Útwisted.spreadr   r   r   r   Útwisted.trialr   ÚViewabler    r½  r$   ÚIRealmr;   rI   r†   rˆ   r˜   r­   r  r¯   r¾   ÚCopyablerÃ   Ú
RemoteCopyrÑ   ÚsetUnjellyableForClassrÕ   râ   ÚsetUnjellyableFactoryForClassrä   Ú	Cacheablerí   rò   rô   ÚRemoteCacher  r  r.  r:  rO  r`  rh  rn  rx  ÚRootr|  r‡  ÚSynchronousTestCaser�  r¨   r¾  ÚTestCaserÈ  râ  r…  rz  r{  r}  r  r‹  r–  ÚPublishabler¾  ÚRemotePublishedrÃ  rg  rÒ  rº   rò  rä  rã  ÚLocalAsRemoterþ  rA   r
  r"  r  r1  r=  rS  r  r  r  r(  r3  rO  r,   r+   r(   Ú<module>r     sð  ðñó 
Û 	Û 
Û Û Ý Ý "Ý ç 1ç 6Ñ 6ß Fß =Ó =ß CÑ CÝ 9Ý 3Ý 6ß 'Ý +ß 3Ó 3Ý "ô+ˆB�K‰Kô +ô�r—y‘yô ñ ˆV�]‰]Ó÷Gð Gó ðG÷8ñ 8òv0,÷f4ñ 4ôB  ô  ô4Fô�2×#Ñ#ô ô�2×#Ñ#ô ô
�—‘ô ô	�b—m‘mô 	ð × Ò ˜* oÔ 6ô
,˜Ÿ™ô 
,òð  ×  Ò  Ð!2Ð4EÔ Fô(�×!Ñ!ô (ô�"—,‘,ô ô˜R×-Ñ-ô ô! 2§<¡<ô !ô*%˜Ÿ™ô %ð × Ò Ð6Ð8JÔ Kô�r—~‘~ô ð × Ò ˜+Ð'7Ô 8ô�"×"Ñ"ô ô5�×!Ñ!ô 5ô�R×%Ñ%ô ô,,ˆr×Ñô ,ô�2—;‘; §¡ô ð
 × Ò ˜,¨Ô 5ô'�B—K‘K §¡ô 'ð × Ò ˜-¨Ô 7ô˜Ÿ™ b§n¡nô ð
 × Ò Ð+Ð->Ô ?ôˆR�W‰Wô ô�R—W‘Wô ôO�H×0Ñ0ô Oôd B×$6Ñ$6ô ô@4˜(×+Ñ+ô 4ônR
�(×#Ñ#ô R
ðj €	à€Ø€òô#�× Ñ ô #ô#�B×$Ñ$ô #ôi5�(×#Ñ#ô i5ôX'�g×)Ñ)ô 'ô
 ˆg×%Ñ%ô  ô
�2×#Ñ#ô ð × Ò ˜/¨7Ô 3ô@-˜×*Ñ*ô @-ôF	ˆyô 	ô�"—+‘+ô ô
�×!Ñ!ô ô

�d×(Ñ(ô 
ñ ˆR�_‰_Óô �B—I‘Ió  ó ð ÷FXñ XôB/ˆR�[‰[ô /ô
H�ô Hô*3*�x×(Ñ(ô 3*ôlf�8×$Ñ$ô fñR ˆR�_‰_Ó÷ð ó ðô#ˆx× Ñ ô #ôL�ô ñ  ˆZÓ÷ð ó ðôB="�h×'Ñ'ô ="ô@)1 ×!2Ñ!2õ )1r+   