Ë
    oj6÷  ã                   ó"  — d Z ddlZddlZddlZddlZddlZddlmZ ddlm	Z
 ddlmZ ddlmZmZ ddlmZmZmZ ddlmZmZ dd	lmZmZmZmZ dd
lmZmZmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z'm(Z( ddl)m*Z* ddl+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1  G d„ de-jd                  «      Z3 G d„ de-jh                  «      Z5 eejl                  «       G d„ d«      «       Z7 G d„ d«      Z8d„ Z9 G d„ d«      Z: G d„ de#«      Z;d�d„Z< G d „ d!e-jz                  «      Z> G d"„ d#e-jz                  «      Z? G d$„ d%e-j€                  «      ZA G d&„ d'e-j„                  «      ZC e-jˆ                  eAeC«        G d(„ d)e-j€                  «      ZEd*„ ZF e-jŽ                  eEeF«        G d+„ d,e-jz                  «      ZH G d-„ d.e-j’                  «      ZJ G d/„ d0e-jz                  «      ZK G d1„ d2e-j’                  «      ZL G d3„ d4e-jš                  «      ZN e-jˆ                  eLeN«        G d5„ d6e-jš                  «      ZO e-jˆ                  eJeO«        G d7„ d8e-jz                  «      ZP G d9„ d:e-jz                  «      ZQ G d;„ d<e-jz                  «      ZR G d=„ d>e-jz                  «      ZS G d?„ d@e-j€                  e-j„                  «      ZT e-jˆ                  eTeT«        G dA„ dBe-j€                  e-j„                  «      ZU e-jˆ                  eUeU«        G dC„ dDe-j’                  e-jš                  «      ZV e-jˆ                  eVeV«        G dE„ dFe-j®                  «      ZX G dG„ dHe-j®                  «      ZY G dI„ dJe1j´                  «      Z[ G dK„ dLe-j¸                  «      Z] G dM„ dNe1j¼                  «      Z_ G dO„ dPe1j¼                  «      Z`dQZadabdacdR„ Zd G dS„ dTe-jz                  «      Ze G dU„ dVe-jz                  «      Zf G dW„ dXe1j¼                  «      Zg G dY„ dZe.jÐ                  «      Zi G d[„ d\e.jÔ                  «      Zk G d]„ d^e-jz                  «      Zl e-jˆ                  eiek«        G d_„ d`e1j¼                  «      Zm G da„ dben«      Zo G dc„ dde-j€                  «      Zp G de„ dfe-jz                  «      Zq G dg„ dhe/jä                  «      Zs ee-jè                  «       G di„ dje-jh                  «      «       Zu G dk„ dl«      Zv G dm„ dne-jd                  «      Zw G do„ dpev«      Zx G dq„ dre1j¼                  «      Zy G ds„ dte1j¼                  «      Zz ee-jè                  «       G du„ dv«      «       Z{ G dw„ dxe1j¼                  «      Z| G dy„ dze«      Z} ee}«       G d{„ d|«      «       Z~ G d}„ d~e1j¼                  «      Z G d„ d€e1j¼                  «      Z€y)‚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                   ó   — e Zd Zd„ Zy)ÚDummyc                 ó&   — t        |t        «      ryy)Nzhello world!zgoodbye, cruel world!)Ú
isinstanceÚDummyPerspective©ÚselfÚusers     ú=/usr/lib/python3/dist-packages/twisted/spread/test/test_pb.pyÚview_doNothingzDummy.view_doNothing(   s   € Ü�dÔ,Ô-Ø!à*ó    N)Ú__name__Ú
__module__Ú__qualname__r(   © r)   r'   r    r    '   s   „ ó+r)   r    c                   ó   — e Zd ZdZd„ Zy)r#   zE
    An L{IPerspective} avatar which will be used in some tests.
    c                 ó   — t        «       S ©N)r    ©r%   s    r'   Úperspective_getDummyViewPointz.DummyPerspective.perspective_getDummyViewPoint4   s	   € Ü‹wˆr)   N)r*   r+   r,   Ú__doc__r2   r-   r)   r'   r#   r#   /   s   „ ñór)   r#   c                   ó   — e Zd Zd„ Zy)Ú
DummyRealmc                 óX   — |D ]%  }|t         j                  u sŒ|t        |«      d„ fc S  y )Nc                   ó   — y r0   r-   r-   r)   r'   ú<lambda>z*DummyRealm.requestAvatar.<locals>.<lambda>=   ó   � r)   )r   ÚIPerspectiver#   )r%   ÚavatarIdÚmindÚ
interfacesÚifaces        r'   ÚrequestAvatarzDummyRealm.requestAvatar:   s2   € Øò 	GˆEØœŸ™Ò'ØÔ.¨xÓ8¹,ÐFÒFñ	Gr)   N)r*   r+   r,   r?   r-   r)   r'   r5   r5   8   s   „ óGr)   r5   c                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)ÚIOPumpz�
    Utility to pump data between clients and servers for protocol testing.

    Perhaps this is a utility worthy of being in protocol.py?
    c                 ó<   — || _         || _        || _        || _        y r0   )ÚclientÚserverÚclientIOÚserverIO)r%   rC   rD   rE   rF   s        r'   Ú__init__zIOPump.__init__G   s   € ØˆŒØˆŒØ ˆŒØ ˆ�r)   c                 óè   — d| _         t        j                  «       dz   }| j                   sH| j                  «       r7t        j                  «       |kD  ry| j                   s| j                  «       rŒ5yyyy)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'   ÚflushzIOPump.flushM   sQ   € ð ˆŒ
Ü—)‘)“+ ‘/ˆØ—*’* §¡¤Ü�y‰y‹{˜WÒ$Øð —*’* §¡¦�* �*r)   c                 ó   — d| _         y)zd
        Stop a running L{flush} operation, even if data remains to be
        transferred.
        TN)rJ   r1   s    r'   ÚstopzIOPump.stopZ   s   € ð
 ˆ�
r)   c                 óò  — | j                   j                  d«       | j                  j                  d«       | j                   j                  «       }| j                  j                  «       }| j                   j                  d«       | j                  j                  d«       | j                   j	                  «        | j                  j	                  «        | j
                  j                  j                  «        | j                  j                  j                  «        t        |«      D ]  }| j                  j                  |«       Œ t        |«      D ]  }| j
                  j                  |«       Œ |s|ryy)zX
        Move data back and forth.

        Returns whether any data was moved.
        r   é   )rE   ÚseekrF   ÚreadÚtruncaterC   Ú	transportÚ_checkProducerrD   r   ÚdataReceived)r%   ÚcDataÚsDataÚbytes       r'   rL   zIOPump.pumpa   s  € ð 	�‰×Ñ˜1ÔØ�‰×Ñ˜1ÔØ—‘×"Ñ"Ó$ˆØ—‘×"Ñ"Ó$ˆØ�‰×Ñ˜1ÔØ�‰×Ñ˜1ÔØ�‰×ÑÔ Ø�‰×ÑÔ Ø�‰×Ñ×,Ñ,Ô.Ø�‰×Ñ×,Ñ,Ô.Ü˜eÓ$ò 	+ˆDØ�K‰K×$Ñ$ TÕ*ð	+ä˜eÓ$ò 	+ˆDØ�K‰K×$Ñ$ TÕ*ð	+á‘EØàr)   N)r*   r+   r,   r3   rG   rN   rP   rL   r-   r)   r'   rA   rA   @   s   „ ñò!òòór)   rA   c                 óÄ  ‡— d}‰j                  |«      }|j                  |«      }t        «       }t        «       }|j                  t        j                  |«      «       |j                  t        j                  |«      «       t        ||||«      }d„ }	ˆfd„}
| j                  |	|«       | j                  |	|«       | j                  |
«       |j                  «        |||fS )al  
    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                 ó‚   — | j                   s3| j                  t        j                  t        j
                  «      «       y y r0   )ÚdisconnectedÚconnectionLostr   ÚFailurer   ÚCONNECTION_DONE)Úbrokers    r'   ÚmaybeDisconnectz/connectServerAndClient.<locals>.maybeDisconnect™   s-   € Ø×"Ò"Ø×!Ñ!¤'§/¡/´$×2FÑ2FÓ"GÕHð #r)   c                  ón   •— ‰ j                  d t        j                  t        j                  «      ¬«       y )N)Ú	connectorÚreason)ÚclientConnectionLostr   ra   r   rb   )ÚclientFactorys   €r'   ÚdisconnectClientFactoryz7connectServerAndClient.<locals>.disconnectClientFactory�   s,   ø€ ð
 	×*Ñ*Ø¤7§?¡?´4×3GÑ3GÓ#Hð 	+õ 	
r)   )ÚbuildProtocolÚStringIOÚmakeConnectionr   ÚFileWrapperrA   Ú
addCleanuprL   )Útestri   ÚserverFactoryÚaddrÚclientBrokerÚserverBrokerÚclientTransportÚserverTransportrL   rd   rj   s    `         r'   ÚconnectServerAndClientrw   {   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                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_ReconnectingFakeConnectorStatezä
    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                 ó"   — t        «       | _        y r0   )r   Únotificationsr1   s    r'   rG   z(_ReconnectingFakeConnectorState.__init__·   s   € Ü"›WˆÕr)   c                 óP   — t        «       }| j                  j                  |«       |S )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'   ÚnotifyOnConnectz/_ReconnectingFakeConnectorState.notifyOnConnectº   s$   € ô “:ˆØ×Ñ×%Ñ% hÔ/Øˆr)   c                 óŠ   — | j                   r7| j                   j                  «       j                  | «       | j                   rŒ6yy)z1
        Fire all pending notifications.
        N)r{   ÚpopÚcallbackr1   s    r'   Ú	notifyAllz)_ReconnectingFakeConnectorState.notifyAllÇ   s5   € ð × Ò Ø×Ñ×"Ñ"Ó$×-Ñ-¨dÔ3ð × Õ r)   N)r*   r+   r,   r3   rG   r   rƒ   r-   r)   r'   ry   ry   ®   s   „ ñò%òó4r)   ry   c                   ó,   ‡ — e Zd ZdZˆ fd„Zˆ fd„Zˆ xZS )Ú_ReconnectingFakeConnectorzc
    A fake L{IConnector} that can fire L{Deferred}s when its
    C{connect} method is called.
    c                 ó2   •— t         ‰| �  |«       || _        y)a  
        @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)ÚsuperrG   Ú_state)r%   r   ÚstateÚ	__class__s      €r'   rG   z#_ReconnectingFakeConnector.__init__Õ   s   ø€ ô 	‰Ñ˜Ô!Øˆ�r)   c                 óV   •— t         ‰| �  «        | j                  j                  «        y)zM
        A C{connect} implementation that calls C{reconnectCallback}
        N)r‡   Úconnectrˆ   rƒ   )r%   rŠ   s    €r'   rŒ   z"_ReconnectingFakeConnector.connectá   s   ø€ ô 	‰‰ÔØ�‰×ÑÕr)   )r*   r+   r,   r3   rG   rŒ   Ú__classcell__)rŠ   s   @r'   r…   r…   Ï   s   ø„ ñô

÷ ð  r)   r…   c                 óà   — |xs
 t        «       }t        j                  d¬«      }t        j                  t        j                  ||g«      «      }t        j                  «       }t        | ||«      S )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)	r5   r   Ú'InMemoryUsernamePasswordDatabaseDontUser   ÚPBServerFactoryr
   ÚPortalÚPBClientFactoryrw   )rp   ÚrealmÚcheckerrq   ri   s        r'   ÚconnectedServerAndClientr—   é   sZ   € ð Ò!”Z“\€EÜ×>Ñ>ÀXÔN€GÜ×&Ñ&¤v§}¡}°U¸W¸IÓ'FÓG€MÜ×&Ñ&Ó(€MÜ! $¨°}ÓEÐEr)   c                   ó   — e Zd Zd„ Zd„ Zy)ÚSimpleRemotec                 ó   — || _         |dz   S ©NrR   )Úarg©r%   rœ   s     r'   Úremote_thunkzSimpleRemote.remote_thunkù   ó   € ØˆŒØ�Q‰wˆr)   c                 ó   — t        «       ‚r0   )Ú	Exceptionr�   s     r'   Úremote_knuthzSimpleRemote.remote_knuthý   s
   € Ü‹kÐr)   N)r*   r+   r,   rž   r¢   r-   r)   r'   r™   r™   ø   s   „ òór)   r™   c                   ó   — e Zd Zd„ Zy)ÚNestedRemotec                 ó   — t        «       S r0   )r™   r1   s    r'   Úremote_getSimplezNestedRemote.remote_getSimple  s
   € Ü‹~Ðr)   N)r*   r+   r,   r¦   r-   r)   r'   r¤   r¤     s   „ ór)   r¤   c                   ó   — e Zd Zd„ Zy)Ú
SimpleCopyc                 ó4   — d| _         ddi| _        dg| _        y ©NrR   ÚHelloÚWorldrp   ©ÚxÚyÚzr1   s    r'   rG   zSimpleCopy.__init__  ó   € ØˆŒØ˜7Ð#ˆŒØ�ˆ�r)   N©r*   r+   r,   rG   r-   r)   r'   r¨   r¨     ó   „ ór)   r¨   c                   ó   — e Zd Zy)ÚSimpleLocalCopyN©r*   r+   r,   r-   r)   r'   rµ   rµ     ó   „ Ør)   rµ   c                   ó0   — e Zd ZU dZi Zeed f   ed<   d„ Zy)ÚSimpleFactoryCopyz]
    @cvar allIDs: hold every created instances of this class.
    @type allIDs: C{dict}
    ÚallIDsc                 ó8   — || _         | t        j                  |<   y r0   )Úidr¹   rº   )r%   r¼   s     r'   rG   zSimpleFactoryCopy.__init__  s   € ØˆŒØ'+Ô× Ñ  Ò$r)   N)	r*   r+   r,   r3   rº   r   ÚintÚ__annotations__rG   r-   r)   r'   r¹   r¹     s#   … ñð
 .0€FˆD�Ð)Ð)Ñ*Ó/ó,r)   r¹   c                 óø   — | j                  dd«      }|€t        dt        | «      › �«      ‚|t        j                  vrt        dt        j                  › �«      ‚t        j                  |   }|st        d«      ‚|S )zl
    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                   ó   — e Zd Zd„ Zd„ Zy)Ú
NestedCopyc                 ó   — t        «       S r0   )r¨   r1   s    r'   Úremote_getCopyzNestedCopy.remote_getCopy5  s
   € Ü‹|Ðr)   c                 ó   — t        |«      S r0   )r¹   )r%   Úvalues     r'   Úremote_getFactoryzNestedCopy.remote_getFactory8  s   € Ü  Ó'Ð'r)   N)r*   r+   r,   rÉ   rÌ   r-   r)   r'   rÇ   rÇ   4  s   „ òó(r)   rÇ   c                   ó   — e Zd Zd„ Zy)ÚSimpleCachec                 ó4   — d| _         ddi| _        dg| _        y rª   r­   r1   s    r'   Ú	__init___zSimpleCache.__init___=  r±   r)   N)r*   r+   r,   rÐ   r-   r)   r'   rÎ   rÎ   <  r³   r)   rÎ   c                   ó   — e Zd Zd„ Zd„ Zy)ÚNestedComplicatedCachec                 ó"   — t        «       | _        y r0   )ÚVeryVeryComplicatedCacheableÚcr1   s    r'   rG   zNestedComplicatedCache.__init__D  s   € Ü-Ó/ˆ�r)   c                 ó   — | j                   S r0   )rÕ   r1   s    r'   Úremote_getCachez&NestedComplicatedCache.remote_getCacheG  s   € Ø�v‰vˆr)   N)r*   r+   r,   rG   r×   r-   r)   r'   rÒ   rÒ   C  s   „ ò0ór)   rÒ   c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)rÔ   c                 ó.   — d| _         d| _        d| _        y )NrR   é   é   ©r®   r¯   Úfoor1   s    r'   rG   z%VeryVeryComplicatedCacheable.__init__L  s   € ØˆŒØˆŒØˆ�r)   c                 óJ   — d| _         | j                  j                  dd«       y )Né   rÝ   )rÝ   ÚobserverÚ
callRemoter1   s    r'   ÚsetFoo4z$VeryVeryComplicatedCacheable.setFoo4Q  s   € ØˆŒØ�‰× Ñ  ¨Õ*r)   c                 óX   — || _         | j                  | j                  | j                  dœS )NrÜ   )rà   r®   r¯   rÝ   ©r%   Úperspectiverà   s      r'   ÚgetStateToCacheAndObserveForz9VeryVeryComplicatedCacheable.getStateToCacheAndObserveForU  s"   € Ø ˆŒØ—V‘V $§&¡&°·±Ñ:Ð:r)   c                 ó~   — t        j                  d«       |j                  d«       || j                  k(  rd | _        y y )Nzstopped observingÚend)r   Úmsgrá   rà   rä   s      r'   ÚstoppedObservingz-VeryVeryComplicatedCacheable.stoppedObservingY  s5   € Ü�‰Ð#Ô$Ø×Ñ˜EÔ"Ø�t—}‘}Ò$Ø ˆD�Mð %r)   N)r*   r+   r,   rG   râ   ræ   rê   r-   r)   r'   rÔ   rÔ   K  s   „ òò
+ò;ó!r)   rÔ   c                   ó   — e Zd Zd„ Zd„ Zy)ÚRatherBaroqueCachec                 ó   — || _         y r0   ©rÝ   )r%   ÚnewFoos     r'   Úobserve_foozRatherBaroqueCache.observe_fooa  s	   € Øˆ�r)   c                 ó.   — t        j                  d«       y )Nzthe end of things)r   ré   r1   s    r'   Úobserve_endzRatherBaroqueCache.observe_endd  s   € Ü�‰Ð#Õ$r)   N)r*   r+   r,   rð   rò   r-   r)   r'   rì   rì   `  s   „ òó%r)   rì   c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚSimpleLocalCachec                 ó:   — | j                   j                  |«       y r0   )Ú__dict__Úupdate)r%   r‰   s     r'   ÚsetCopyableStatez!SimpleLocalCache.setCopyableStatel  s   € Ø�‰×Ñ˜UÕ#r)   c                 ó   — | j                   S r0   )Úcheckr1   s    r'   ÚcheckMethodzSimpleLocalCache.checkMethodo  ó   € Ø�z‰zÐr)   c                 ó   — | S r0   r-   r1   s    r'   Ú	checkSelfzSimpleLocalCache.checkSelfr  s   € Øˆr)   c                  ó   — yr›   r-   r1   s    r'   rú   zSimpleLocalCache.checku  s   € Ør)   N)r*   r+   r,   rø   rû   rþ   rú   r-   r)   r'   rô   rô   k  s   „ ò$òòór)   rô   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚNestedCachec                 ó"   — t        «       | _        y r0   )rÎ   r®   r1   s    r'   rG   zNestedCache.__init__}  s   € Ü“ˆ�r)   c                 ó2   — | j                   | j                   gS r0   ©r®   r1   s    r'   r×   zNestedCache.remote_getCache€  s   € Ø—‘˜Ÿ™ÐÐr)   c                 ó   — | j                   |u S r0   r  ©r%   Úcaches     r'   Úremote_putCachezNestedCache.remote_putCacheƒ  s   € Ø�v‰v˜ˆÐr)   N)r*   r+   r,   rG   r×   r  r-   r)   r'   r  r  |  s   „ òò ór)   r  c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)Ú
Observablec                 ó   — g | _         y r0   )Ú	observersr1   s    r'   rG   zObservable.__init__ˆ  s	   € Øˆ�r)   c                 ó:   — | j                   j                  |«       y r0   )r  Úappend©r%   Úobss     r'   Úremote_observezObservable.remote_observe‹  ó   € Ø�‰×Ñ˜cÕ"r)   c                 ó:   — | j                   j                  |«       y r0   )r  Úremover  s     r'   Úremote_unobservezObservable.remote_unobserveŽ  r  r)   c                 óL   — | j                   D ]  }|j                  d| |«       Œ y )NÚnotify)r  rá   )r%   Úobjrà   s      r'   r  zObservable.notify‘  s'   € ØŸ™ò 	5ˆHØ×Ñ ¨$°Õ4ñ	5r)   N)r*   r+   r,   rG   r  r  r  r-   r)   r'   r
  r
  ‡  s   „ òò#ò#ó5r)   r
  c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚDeferredRemotec                 ó   — d| _         y )Nr   ©Úrunr1   s    r'   rG   zDeferredRemote.__init__—  s	   € Øˆ�r)   c                 ó   — || _         |dz   S r›   r  r�   s     r'   ÚrunMezDeferredRemote.runMeš  rŸ   r)   c                 ó   — J d«       ‚)Nzshouldn't have been run!r-   r�   s     r'   Ú	dontRunMezDeferredRemote.dontRunMež  s   € Ø,Ð,Ó,ˆqr)   c                 ót   — t        «       }|j                  | j                  | j                  «       || _        |S )zo
        Return a L{Deferred} to be fired on client side. When fired,
        C{self.runMe} is called.
        )r   ÚaddCallbacksr  r!  Úd)r%   r$  s     r'   Úremote_doItLaterzDeferredRemote.remote_doItLater¡  s-   € ô
 ‹JˆØ	�‰�t—z‘z 4§>¡>Ô2ØˆŒØˆr)   N)r*   r+   r,   rG   r  r!  r%  r-   r)   r'   r  r  –  s   „ òòò-ór)   r  c                   ó   — e Zd ZdZdZd„ Zy)ÚObserverr   Nc                 ó^   — || _         | j                  dz   | _        |j                  d| «       y )NrR   Ú	unobserve)r  Únotifiedrá   )r%   Úotherr  s      r'   Úremote_notifyzObserver.remote_notify°  s)   € ØˆŒØŸ™¨Ñ)ˆŒØ×Ñ˜ dÕ+r)   )r*   r+   r,   r*  r  r,  r-   r)   r'   r'  r'  ¬  s   „ Ø€HØ
€Có,r)   r'  c                   ó   — e Zd Zd„ Zy)ÚNewStyleCopyc                 ó   — || _         y r0   )Ús)r%   r0  s     r'   rG   zNewStyleCopy.__init__·  s	   € Øˆ�r)   Nr²   r-   r)   r'   r.  r.  ¶  s   „ ór)   r.  c                   ó$   — e Zd ZdZdZdZd„ Zd„ Zy)ÚNewStyleCopy2r   rR   c                 óp   — t         xj                  dz  c_        t        j                  | «      }d|_        |S )NrR   rÚ   )r2  Ú	allocatedÚobjectÚ__new__rË   )r%   rÄ   s     r'   r6  zNewStyleCopy2.__new__Ã  s-   € Ü×Ò 1Ñ$ÕÜ�~‰~˜dÓ#ˆØˆŒ
Øˆr)   c                 ó6   — t         xj                  dz  c_        y r›   )r2  Úinitializedr1   s    r'   rG   zNewStyleCopy2.__init__É  s   € Ü×!Ò! QÑ&Ö!r)   N)r*   r+   r,   r4  r8  rË   r6  rG   r-   r)   r'   r2  r2  ¾  s   „ Ø€IØ€KØ€Eòó'r)   r2  c                   ó   — e Zd Zd„ Zy)ÚNewStyleCacheCopyc                 ó   — | j                   S r0   )rö   rä   s      r'   ræ   z.NewStyleCacheCopy.getStateToCacheAndObserveForÑ  s   € Ø�}‰}Ðr)   N)r*   r+   r,   ræ   r-   r)   r'   r:  r:  Ð  s   „ ór)   r:  c                   ó   — e Zd Zd„ Zd„ Zy)ÚEchoerc                 ó   — |S r0   r-   ©r%   Ústs     r'   Úremote_echozEchoer.remote_echoÙ  s   € Øˆ	r)   c                 ó
   — ||fS r0   r-   )r%   r@  Úkws      r'   Úremote_echoWithKeywordszEchoer.remote_echoWithKeywordsÜ  s   € Ø�Bˆxˆr)   N)r*   r+   r,   rA  rD  r-   r)   r'   r=  r=  Ø  s   „ òór)   r=  c                   ó   — e Zd Zd„ Zd„ Zy)ÚCachedReturnerc                 ó   — || _         y r0   ©r  r  s     r'   rG   zCachedReturner.__init__á  s	   € Øˆ�
r)   c                 ó   — | j                   S r0   rH  r?  s     r'   Úremote_giveMeCachez!CachedReturner.remote_giveMeCacheä  rü   r)   N)r*   r+   r,   rG   rJ  r-   r)   r'   rF  rF  à  s   „ òór)   rF  c                   ó*   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚNewStyleTestsc                 ó  — t        j                  t        «       «      | _        t        j                  «       }t        | || j                  ¬«      \  }| _        | _        | j                  |j                  «       «      | _
        y)zY
        Create a pb server using L{Echoer} protocol and connect a client to it.
        )rp   ri   rq   N)r   r’   r=  rq   r”   rw   rD   rL   ÚsuccessResultOfÚgetRootObjectÚref)r%   ri   rC   s      r'   ÚsetUpzNewStyleTests.setUpé  sf   € ô  ×/Ñ/´³Ó9ˆÔÜ×*Ñ*Ó,ˆÜ)?Ø ]À$×BTÑBTô*
Ñ&ˆ�”˜TœYð ×'Ñ'¨×(CÑ(CÓ(EÓFˆ�r)   c                 óF   — dt         _        dt         _        dt         _        y)zp
        Close client and server connections, reset values of L{NewStyleCopy2}
        class variables.
        r   rR   N)r2  r4  r8  rË   r1   s    r'   ÚtearDownzNewStyleTests.tearDownô  s   € ð
 #$ŒÔØ$%ŒÔ!ØŒÕr)   c                 óº   ‡ ‡— t        d«      Š‰ j                  j                  d‰«      }‰ j                  j	                  «        ˆˆ fd„}|j                  |«       |S )zY
        Create a new style object, send it over the wire, and check the result.
        rË   Úechoc                 ó�   •— ‰j                  | t        «       ‰j                  | j                  d«       ‰j	                  | ‰u «       y )NrË   )ÚassertIsInstancer.  ÚassertEqualr0  ÚassertFalse©ÚresÚorigr%   s    €€r'   Úcbz'NewStyleTests.test_newStyle.<locals>.cb  s9   ø€ Ø×!Ñ! #¤|Ô4Ø×Ñ˜SŸU™U GÔ,Ø×Ñ˜S D˜[Õ)r)   ©r.  rP  rá   rL   rN   ÚaddCallback©r%   r$  r]  r\  s   `  @r'   Útest_newStylezNewStyleTests.test_newStyleý  sK   ù€ ô ˜GÓ$ˆØ�H‰H×Ñ ¨Ó-ˆØ�	‰	�‰Ôõ	*ð
 	
�‰�bÔØˆr)   c                 ó8  ‡ ‡— t        «       Š‰ j                  t         j                  d«       ‰ j                  t         j                  d«       ‰ j                  j                  d‰«      }‰ j                  j                  «        ˆˆ fd„}|j                  |«       |S )zN
        Send a new style object and check the number of allocations.
        rR   rU  c                 ó  •— ‰j                  | t        «       ‰j                  | j                  d«       ‰j                  t        j                  d«       ‰j                  t        j
                  d«       ‰j                  | ‰«       y )NrÚ   rÛ   rR   )rW  r2  rX  rË   r4  r8  ÚassertIsNotrZ  s    €€r'   r]  z$NewStyleTests.test_alloc.<locals>.cb  sc   ø€ à×!Ñ! #¤}Ô5Ø×Ñ˜SŸY™Y¨Ô*Ø×Ñœ]×4Ñ4°aÔ8Ø×Ñœ]×6Ñ6¸Ô:Ø×Ñ˜S $Õ'r)   )	r2  rX  r4  r8  rP  rá   rL   rN   r_  r`  s   `  @r'   Ú
test_alloczNewStyleTests.test_alloc  st   ù€ ô ‹ˆØ×Ñœ×0Ñ0°!Ô4Ø×Ñœ×2Ñ2°AÔ6Ø�H‰H×Ñ ¨Ó-ˆØ�	‰	�‰Ôõ	(ð 	
�‰�bÔØˆr)   c                 óÀ   ‡ ‡— t        d«      Š‰ j                  j                  d‰dd¬«      }‰ j                  j	                  «        ˆˆ fd„}|j                  |«       |S )zo
        Create a new style object with keywords,
        send it over the wire, and check the result.
        Úvalue1ÚechoWithKeywordsÚoneÚtwo©Úkeyword1Úkeyword2c                 ó.  •— ‰j                  | t        «       ‰j                  | d   t        «       ‰j                  | d   t        «       ‰j	                  | d   j
                  d«       ‰j                  | d   ‰«       ‰j	                  | d   dddœ«       y )Nr   rR   rg  ri  rj  rk  )rW  Útupler.  ÚdictrX  r0  rd  rZ  s    €€r'   r]  z3NewStyleTests.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_newStyleWithKeywordsz'NewStyleTests.test_newStyleWithKeywords#  sZ   ù€ ô
 ˜HÓ%ˆØ�H‰H×ÑØ ¨u¸uð  ó 
ˆð 	�	‰	�‰Ôõ	Mð 	
�‰�bÔØˆr)   N)r*   r+   r,   rQ  rS  ra  re  rq  r-   r)   r'   rL  rL  è  s   „ ò	Gò òò ó,r)   rL  c                   ó    — e Zd ZdZdZd„ Zd„ Zy)ÚConnectionNotifyServerFactoryaj  
    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                 ób   — t         j                  j                  | |«       t        «       | _        y)z)
        Initialize the factory.
        N)r   r’   rG   r   ÚconnectionMade)r%   Úroots     r'   rG   z&ConnectionNotifyServerFactory.__init__I  s$   € ô 	×Ñ×#Ñ# D¨$Ô/Ü&›jˆÕr)   c                 ób   — || _         | j                  dc}| _        |�|j                  d«       yy)zF
        Store the protocol and fire the connection deferred.
        N)ÚprotocolInstanceru  r‚   )r%   r   r$  s      r'   ÚclientConnectionMadez2ConnectionNotifyServerFactory.clientConnectionMadeP  s7   € ð !)ˆÔØ!%×!4Ñ!4°dÐˆˆ4ÔØˆ=Ø�J‰J�tÕð r)   )r*   r+   r,   r3   rx  rG   ry  r-   r)   r'   rs  rs  :  s   „ ñ
ð Ðò)ór)   rs  c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚNewStyleCachedTestsc                 óî  ‡ — t        «       ‰ _        d‰ j                  _        t        j                  dt        t        ‰ j                  «      «      «      ‰ _        t        j                  «       }t        j                  d‰ j                  j                  «       j                  |«       ˆ fd„}|j                  «       j                  |«      }‰ j                  j                  j                   }t#        ||g«      S )zi
        Create a pb server using L{CachedReturner} protocol and connect a
        client to it.
        rË   r   Ú	localhostc                 ó   •— | ‰_         y r0   )rP  )rP  r%   s    €r'   ÚgotRootz*NewStyleCachedTests.setUp.<locals>.gotRooth  s
   ø€ ØˆD�Hr)   )r:  r\  r0  r   Ú	listenTCPrs  rF  rD   r   r”   Ú
connectTCPÚgetHostÚportrO  r_  Úfactoryru  r   )r%   ri   r  Úd1Úd2s   `    r'   rQ  zNewStyleCachedTests.setUp[  s¹   ø€ ô
 &Ó'ˆŒ	Øˆ�	‰	ŒÜ×'Ñ'ØÔ,¬^¸D¿I¹IÓ-FÓGó
ˆŒô ×*Ñ*Ó,ˆÜ×Ñ˜;¨¯©×(;Ñ(;Ó(=×(BÑ(BÀMÔRô	ð ×(Ñ(Ó*×6Ñ6°wÓ?ˆØ�[‰[× Ñ ×/Ñ/ˆÜ˜b "˜XÓ&Ð&r)   c                 ó  — | j                   j                  j                  j                  j	                  «        | j
                  j                  j                  j	                  «        | j                   j                  «       S )z6
        Close client and server connections.
        )rD   r„  rx  rV   ÚloseConnectionrP  rc   ÚstopListeningr1   s    r'   rS  zNewStyleCachedTests.tearDowno  sS   € ð 	�‰×Ñ×,Ñ,×6Ñ6×EÑEÔGØ�‰�‰×!Ñ!×0Ñ0Ô2Ø�{‰{×(Ñ(Ó*Ð*r)   c                 ó¦   ‡ — ‰ j                   j                  d‰ j                  «      }ˆ fd„}|j                  |d«       |j                  |d«       |S )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                 ó   •— ‰j                  | t        «       ‰j                  d| j                  «       ‰j	                  ‰j
                  | «       |r-| ‰_        ‰j                  j                  d‰j
                  «      S y )NrË   r‹  )	rW  r:  rX  r0  rd  r\  r[  rP  rá   )r[  Úagainr%   s     €r'   r]  z2NewStyleCachedTests.test_newStyleCache.<locals>.cb  sh   ø€ Ø×!Ñ! #Ô'8Ô9Ø×Ñ˜W c§e¡eÔ,à×Ñ˜TŸY™Y¨Ô,áà�”ð —x‘x×*Ñ*¨=¸$¿)¹)ÓDÐDð r)   TF)rP  rá   r\  r_  )r%   r$  r]  s   `  r'   Útest_newStyleCachez&NewStyleCachedTests.test_newStyleCachew  sH   ø€ ð �H‰H×Ñ ¨t¯y©yÓ9ˆô	Eð 	
�‰�b˜$ÔØ	�‰�b˜%Ô Øˆr)   N)r*   r+   r,   rQ  rS  rŽ  r-   r)   r'   r{  r{  Z  s   „ ò'ò(+ór)   r{  c                   óv   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚBrokerTestsNc                 óN   — 	 t        j                  d«       y # t        $ r Y y w xY w)NúNone-None-TESTING.pub)ÚosÚunlinkÚOSErrorr1   s    r'   rS  zBrokerTests.tearDown”  s&   € ð	ä�I‰IÐ-Õ.øÜò 	Ùð	ús   ‚ ˜	$£$c                 ó,   — | j                  d|› �«       y )Nz&This should cause a return value, not ©Úfail)r%   Úerrors     r'   ÚthunkErrorBadzBrokerTests.thunkErrorBad›  s   € Ø�	‰	Ð:¸5¸'ÐBÕCr)   c                 ó   — || _         y r0   )ÚthunkResult©r%   Úresults     r'   ÚthunkResultGoodzBrokerTests.thunkResultGoodž  s
   € Ø!ˆÕr)   c                  ó   — y r0   r-   )r%   Útbs     r'   ÚthunkErrorGoodzBrokerTests.thunkErrorGood¡  ó   € Ør)   c                 ó,   — | j                  d|› �«       y )Nz This should cause an error, not r—  r�  s     r'   ÚthunkResultBadzBrokerTests.thunkResultBad¤  s   € Ø�	‰	Ð4°V°HÐ=Õ>r)   c                 ó  — t        | ¬«      \  }}} G d„ dt        j                  «      } G d„ dt        j                  «      }|j                  d |«       «       |j	                  d«      } |«       } |«       }|j                  d||«       |j                  «        |j                  «        |j                  «        | j                  |j                  |d«       | j                  |j                  d«      |j                  d«      «       y )	N©rp   c                   ó   — e Zd Zd„ Zy)ú%BrokerTests.test_reference.<locals>.Xc                 ó   — || _         y r0   )Úcaughtr�   s     r'   Úremote_catchz2BrokerTests.test_reference.<locals>.X.remote_catch«  s	   € Ø!�•r)   N)r*   r+   r,   r¬  r-   r)   r'   ÚXr©  ª  s   „ ó"r)   r­  c                   ó   — e Zd Zd„ Zy)ú%BrokerTests.test_reference.<locals>.Yc                 ó(   — |j                  d|«       y )NÚcatch©rá   ©r%   ÚaÚbs      r'   Úremote_throwz2BrokerTests.test_reference.<locals>.Y.remote_throw¯  s   € Ø—‘˜W aÕ(r)   N)r*   r+   r,   r¶  r-   r)   r'   ÚYr¯  ®  s   „ ó)r)   r·  r¯   ÚthrowzX should have caught Z)r—   r   ÚReferenceableÚsetNameForLocalÚremoteForNamerá   rL   ÚassertIsr«  rX  ÚremoteMethod)	r%   rÕ   r0  rL   r­  r·  r¯   r®   r°   s	            r'   Útest_referencezBrokerTests.test_reference§  sÊ   € Ü-°4Ô8‰
ˆˆ1ˆdô	"”× Ñ ô 	"ô	)”× Ñ ô 	)ð 	
×Ñ˜#™q›sÔ#Ø�O‰O˜CÓ ˆÙ‹CˆÙ‹CˆØ	�‰�W˜a Ô#Ø�	‰	ŒØ�	‰	ŒØ�	‰	ŒØ�‰�a—h‘h Ð#;Ô<ð 	×Ñ˜Ÿ™¨Ó0°!·.±.ÀÓ2IÕJr)   c                 óÀ  — t        | ¬«      \  }}}||f||ffD ]Ã  \  }}t        «       }|j                  d|«       |j                  d«      }d| _        |j                  d| j                  dz
  «      j                  | j                  | j                  «       |j                  «        |j                  «        | j                  | j                  | j                  d«       ŒÅ y )Nr§  rÝ   é   ÚthunkrR   zresult wasn't received.)r—   r™   rº  r»  ÚexpectedThunkResultrá   r#  rŸ  rš  rL   rX  rœ  )r%   rÕ   r0  rL   r®   r¯   rÝ   Úbars           r'   Útest_resultzBrokerTests.test_result¿  sÉ   € Ü-°4Ô8‰
ˆˆ1ˆdØ˜�F˜Q ˜F�Nò 	‰DˆAˆqä“.ˆ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                 ó   — || _         y r0   )ÚnestedRemoter�  s     r'   ÚrefcountResultzBrokerTests.refcountResultÓ  s
   € Ø"ˆÕr)   c           
      óv  — g }g }t        | ¬«      \  }}}t        «       }|j                  d|«       |j                  d«      }t	        t
        j                  dz   «      D ]u  }|j                  j                  s|j                  j                  r nG|j                  d«      j                  |j                  |j                  «       |j                  «        Œw t
        j                  dz
  }	| j                  |j                  j                  d«       | j                  t        |«      |	d|	› dt        |«      › �«       y )	Nr§  rÝ   é
   Ú	getSimplerR   ztransport was not closedz	expected z got )r—   r¤   rº  r»  Úranger   ÚMAX_BROKER_REFSrV   Úclosedrá   r#  r  rL   Ú
assertTruerX  Úlen)
r%   ÚlÚerÕ   r0  rL   rÝ   r®   ÚignoÚexpecteds
             r'   Útest_tooManyRefszBrokerTests.test_tooManyRefsÖ  sø   € ØˆØˆÜ-°4Ô8‰
ˆˆ1ˆ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ð		ô
 ×%Ñ%¨Ñ)ˆØ�‰˜Ÿ™×*Ñ*Ð,FÔGØ×Ñœ˜Q› ¨Y°x°jÀÄcÈ!ÃfÀXÐ+NÕOr)   c                 ó  — t        | ¬«      \  }}}t        «       }|j                  d|«       |j                  d«      }|j	                  d«      j                  | j                  | j                  «       |j                  «        |j                  «        | j                  | j                  j                  d«       | j                  | j                  j                  d   d«       | j                  | j                  j                  d   d«       y )	Nr§  rÝ   ÚgetCopyrR   r«   r¬   r   rp   )r—   rÇ   rº  r»  rá   r#  rŸ  rš  rL   rX  rœ  r®   r¯   r°   )r%   rÕ   r0  rL   rÝ   r®   s         r'   Ú	test_copyzBrokerTests.test_copyæ  sÌ   € Ü-°4Ô8‰
ˆˆ1ˆdÜ‹lˆØ	×Ñ˜% Ô%Ø�O‰O˜EÓ"ˆØ	�‰�YÓ×,Ñ,¨T×-AÑ-AÀ4×CUÑCUÔVØ�	‰	ŒØ�	‰	ŒØ×Ñ˜×)Ñ)×+Ñ+¨QÔ/Ø×Ñ˜×)Ñ)×+Ñ+¨GÑ4°gÔ>Ø×Ñ˜×)Ñ)×+Ñ+¨AÑ.°Õ7r)   c                 ó  — t        | ¬«      \  }}}t        «       }t        «       }|j                  d|«       |j	                  d«      }|j                  d|«       |j                  «        |j                  d«       |j                  «        |j                  «        |j                  d«       |j                  «        |j                  «        | j                  |j                  d«       | j                  |j                  dd«       y )Nr§  r´  ÚobserverR   rÉ  zdidn't notifyznotified too much)r—   r
  r'  rº  r»  rá   rL   r  ÚassertIsNotNoner  rX  )r%   rÕ   r0  rL   r´  rµ  Úras          r'   Útest_observezBrokerTests.test_observeò  s¼   € Ü-°4Ô8‰
ˆˆ1ˆdô ‹LˆÜ‹JˆØ	×Ñ˜#˜qÔ!Ø�_‰_˜SÓ!ˆØ
�‰�i Ô#Ø�	‰	ŒØ	�‰�ŒØ�	‰	ŒØ�	‰	ŒØ	�‰�ŒØ�	‰	ŒØ�	‰	ŒØ×Ñ˜QŸU™U OÔ4Ø×Ñ˜Ÿ™ Ð#6Õ7r)   c                 ój  — t        | ¬«      \  }}}t        «       }|j                  d|«       |j                  d«      }|j	                  «        |j	                  «        g }|j                  d«      j                  |j                  «       |j	                  «        |j	                  «        | j                  |j                  d«       |j                  j                  d«       | j                  |j                  dd«       |j	                  «        |j	                  «        | j                  |d   dd	«       y )
Nr§  r$  Ú	doItLaterzDeferred method run too early.rI   zDeferred method run too late.r   é   zIncorrect result.)r—   r  rº  r»  rL   rá   r_  r  rY  r  r$  r‚   rX  )r%   rÕ   r0  rL   r$  rÑ  Úresultss          r'   Ú
test_deferzBrokerTests.test_defer  sà   € Ü-°4Ô8‰
ˆˆ1ˆdÜÓˆØ	×Ñ˜#˜qÔ!Ø�O‰O˜CÓ ˆØ�	‰	ŒØ�	‰	ŒØˆØ	�‰�[Ó!×-Ñ-¨g¯n©nÔ=Ø�	‰	ŒØ�	‰	ŒØ×Ñ˜Ÿ™Ð @ÔAØ	�‰�‰�QŒØ×Ñ˜Ÿ™ Ð#BÔCØ�	‰	ŒØ�	‰	ŒØ×Ñ˜ ™ QÐ(;Õ<r)   c                 óv  — t        | ¬«      \  }}}t        «       }|j                  d|«       |j                  d«      }|j	                  d«      j                  | j                  | j                  «       |j                  «        |j                  «        | j                  j                  }| j                  ||j                  «       | `	t        j                  dk\  rt        j                   «        |j                  «        |j                  «        |j                  «        | j#                  ||j                  «       y )Nr§  rÝ   rÊ  é   )r—   r¤   rº  r»  rá   r#  rÇ  rš  rL   rÆ  ÚluidÚassertInÚlocalObjectsÚsysÚ
hexversionÚgcÚcollectÚassertNotIn)r%   rÕ   r0  rL   rÝ   rÃ  Úrluids          r'   Útest_refcountzBrokerTests.test_refcount  sâ   € Ü-°4Ô8‰
ˆˆ1ˆdÜ‹nˆØ	×Ñ˜% Ô%Ø�o‰o˜eÓ$ˆØ�‰�{Ó#×0Ñ0Ø×Ñ ×!3Ñ!3ô	
ð
 	�	‰	Œà�	‰	Œð ×!Ñ!×&Ñ&ˆØ�‰�e˜QŸ^™^Ô,ØÐä�>‰>˜YÒ&Ü�J‰JŒLà�	‰	ŒØ�	‰	ŒØ�	‰	ŒØ×Ñ˜ §¡Õ/r)   c                 ó*  — t        | ¬«      \  }}}t        «       }t        «       }|j                  }|j	                  d|«       |j	                  d|«       |j                  d«      }|j                  d«      }g }	|j                  d«      j                  |	j                  «      j                  |	j                  «       |j                  d«      j                  |	j                  «      j                  |	j                  «       g }
|j                  d«      j                  |
j                  «       |j                  d«      j                  |
j                  «       |j                  «        | j                  |
d   j                  d«       | j                  |
d   j                  d«       | j                  |
d   j                  d«       |j                  «        |j                  «        | j                  |
d   j                  d	«       | j                  t!        |	«      d«       |	d   d   }| j#                  |j%                  «       j&                  |d
«       | j#                  |j)                  «       |d«       g }|j                  d|«      j                  |j                  «       |j                  «        | j+                  |d   «       | j                  |j-                  d«      |j-                  d«      «       |j.                  }|
d   j.                  }| j1                  ||j2                  d«       ~	~|j                  «        ~
~|j                  «        t4        j6                  dk\  rt9        j:                  «        |j                  «        | j=                  ||j2                  d«       | j=                  ||j>                  d«       | j=                  ||j2                  d«       | j=                  ||j>                  d«       | jA                  |jB                  d«       y )Nr§  r  ÚxxxÚgetCacher   rR   rÚ   rÛ   rß   zpotential refcounting issuez!other potential refcounting issueÚputCachezremote cache doesn't have itrã  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  Ú
addErrbackrN   rX  r®   r¯   rÝ   râ   rÏ  ÚassertIdenticalrû   Ú__self__rþ   rÎ  r½  rä  rå  ÚremotelyCachedObjectsrç  rè  ré  rê  rë  ÚlocallyCachedObjectsÚassertIsNonerà   )r%   rÕ   r0  rL   r  Úobj2ÚvccÚo2Úo3ÚcollÚcomplexÚcpÚcol2rä  ÚbaroqueLuids                  r'   Ú
test_cachezBrokerTests.test_cache4  s!  € Ü-°4Ô8‰
ˆˆ1ˆ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˜A×3Ñ3Ð5SÔTØØØ�
‰
ŒØØà�
‰
Œô �>‰>˜YÒ&Ü�J‰JŒLà�
‰
Œà×Ñ˜˜q×6Ñ6Ð8VÔWØ×Ñ˜˜q×5Ñ5Ð7UÔVØ×ÑØ˜×0Ñ0Ð2Uô	
ð 	×ÑØ˜×/Ñ/Ð1Tô	
ð 	×Ñ˜#Ÿ,™,Ð(BÕCr)   c                 ó   — 	 t        j                  d«       t        | ¬«      \  }}}t	        «       }|j                  d|«       |j                  d«      }g }|j                  d«      j                  |j                  | j                  «       |j                  «        |j                  «       }| j                  |j                  d«       | j                  |j                  d«       | j                  |j                   d«       | j                  |j"                  d«       t        | ¬«      \  }}}|j                  d|«       |j                  d«      }|j                  d«      j                  |j                  | j                  «       |j                  «        |j                  «       }| j                  |j"                  d«       y # t        $ r Y �Œµw xY w)Nr’  r§  rÝ   ÚgetPubrR   r   )r“  r”  r•  r—   ÚGetPublisherrº  r»  rá   r#  r  rš  rN   r�   rX  ÚactivateCalledÚisActivatedÚyayIGotPublishedÚ_wasCleanWhenLoaded)r%   rÕ   r0  rL   rÝ   rÃ  Úaccumr  s           r'   Útest_publishablezBrokerTests.test_publishablev  sl  € ð	Ü�I‰IÐ-Ô.ô .°4Ô8‰
ˆˆ1ˆdÜ‹nˆà	×Ñ˜% Ô%Ø�o‰o˜eÓ$ˆØˆØ�‰�xÓ ×-Ñ-¨e¯l©l¸D×<NÑ<NÔOØ�
‰
ŒØ�i‰i‹kˆØ×Ñ˜×+Ñ+¨QÔ/Ø×Ñ˜Ÿ™¨!Ô,Ø×Ñ˜×-Ñ-¨qÔ1à×Ñ˜×0Ñ0°!Ô4Ü-°4Ô8‰
ˆˆ1ˆdØ	×Ñ˜% Ô%Ø�o‰o˜eÓ$ˆØ�‰�xÓ ×-Ñ-¨e¯l©l¸D×<NÑ<NÔOØ�
‰
ŒØ�i‰i‹kˆà×Ñ˜×0Ñ0°!Õ4øô/ ò 	Úð	ús   ‚G  Ç 	GÇGc                 ó&   — |j                   | _        y r0   )r¼   rœ  )r%   Úvals     r'   ÚgotCopyzBrokerTests.gotCopy’  s   € ØŸ6™6ˆÕr)   c                 ó¢  — t        | ¬«      \  }}}d}t        «       }|j                  d|«       |j                  d«      }|j	                  d|«      j                  | j                  | j                  «       |j                  «        |j                  «        |j                  «        | j                  | j                  |d| j                  › �«       y )Nr§  éc   rÝ   Ú
getFactoryz!ID not correct on factory object )r—   rÇ   rº  r»  rá   r#  r  r¥  rL   rX  rœ  )r%   rÕ   r0  rL   ÚIDr  r®   s          r'   Útest_factoryCopyzBrokerTests.test_factoryCopy•  s§   € Ü-°4Ô8‰
ˆˆ1ˆdØˆÜ‹lˆØ	×Ñ˜% Ô%Ø�O‰O˜EÓ"ˆØ	�‰�\ 2Ó&×3Ñ3°D·L±LÀ$×BUÑBUÔVØ�	‰	ŒØ�	‰	ŒØ�	‰	ŒØ×ÑØ×ÑØØ/°×0@Ñ0@Ð/AÐBõ	
r)   )r*   r+   r,   rœ  rS  rš  rŸ  r¢  r¥  r¾  rÄ  rÇ  rÔ  r×  rÜ  rá  rí  r  r
  r  r  r-   r)   r'   r�  r�  ‘  sb   „ Ø€KòòDò"òò?òKò0ò(#òPò 
8ò8ò(=ò$0ò8@DòD5ò8"ó
r)   r�  sô  helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldc                  ó   — | a |ay r0   )ÚcallbackArgsÚcallbackKeyword)ÚargsrC  s     r'   ÚfinishedCallbackr  ¬  s   € à€LØ�Or)   c                   ó   — e Zd Zd„ Zd„ Zy)Ú	Pagerizerc                 ó0   — |||c| _         | _        | _        y r0   )r‚   r  rC  )r%   r‚   r  rC  s       r'   rG   zPagerizer.__init__³  s   € Ø,4°d¸BÐ)ˆŒ�t”y $¥'r)   c                 óœ   — t        j                  |t        d| j                  g| j                  ¢­i | j
                  ¤Ž d x| _        | _        y )Néd   )r   ÚStringPagerÚ	bigStringr‚   r  rC  ©r%   Ú	collectors     r'   Úremote_getPageszPagerizer.remote_getPages¶  sE   € Ü×ÑØ”y # t§}¡}ð	
Ø7;·y±yò	
ØDHÇGÁGò	
ð #Ð"ˆŒ	�D•Gr)   N)r*   r+   r,   rG   r!  r-   r)   r'   r  r  ²  s   „ ò?ó#r)   r  c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚFilePagerizerNc                 ó>   — || _         |||c| _        | _        | _        y r0   )Úfilenamer‚   r  rC  )r%   r%  r‚   r  rC  s        r'   rG   zFilePagerizer.__init__À  s   € Ø ˆŒØ,4°d¸BÐ)ˆŒ�t”y $¥'r)   c                 óÄ   — t        j                  |t        | j                  d«      | j                  g| j
                  ¢­i | j                  ¤Ž| _        d x| _        | _        y )NÚrb)r   Ú	FilePagerÚopenr%  r‚   r  rC  Úpagerr  s     r'   r!  zFilePagerizer.remote_getPagesÄ  sP   € Ü—^‘^Ø”t˜DŸM™M¨4Ó0°$·-±-ð
ØBFÇ)Á)ò
ØOSÏwÉwñ
ˆŒ
ð #Ð"ˆŒ	�D•Gr)   )r*   r+   r,   r*  rG   r!  r-   r)   r'   r#  r#  ½  s   „ Ø€Eò?ó#r)   r#  c                   ó4   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	y)	ÚPagingTestsz0
    Test pb objects sending data by pages.
    c                 ó®   — | j                  «       | _        t        | j                  d«      5 }|j                  t        «       ddd«       y# 1 sw Y   yxY w)z?
        Create a file used to test L{util.FilePager}.
        ÚwbN)Úmktempr%  r)  Úwriter  )r%   Úfs     r'   rQ  zPagingTests.setUpÐ  sB   € ð Ÿ™›ˆŒÜ�$—-‘- Ó&ð 	¨!Ø�G‰G”IÔ÷	÷ 	ñ 	ús   ¬AÁAc                 óÈ  — t        | ¬«      \  }}}|j                  dt        t        dd¬«      «       |j	                  d«      }g }t        j                  |d«      j                  |j                  «       |s|j                  «        |sŒ| j                  dj                  |d   «      t        d	«       | j                  t        d
d«       | j                  t        ddid«       y)zg
        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!)r3  úCompleted callback not invokedrË   N)r—   rº  r  r  r»  r   ÚgetAllPagesr_  r  rL   rX  Újoinr  r  r  ©r%   rÕ   r0  rL   r®   rÐ  s         r'   Útest_pagingWithCallbackz#PagingTests.test_pagingWithCallbackØ  sÂ   € ô
 .°4Ô8‰
ˆˆ1ˆ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                 óZ  — t        | ¬«      \  }}}|j                  dt        d«      «       |j                  d«      }g }t	        j
                  |d«      j                  |j                  «       |s|j                  «        |sŒ| j                  dj                  |d   «      t        d«       y)z>
        Test L{util.StringPager} without a callback.
        r§  rÝ   Nr5  r)   r   r6  )r—   rº  r  r»  r   r8  r_  r  rL   rX  r9  r  r:  s         r'   Útest_pagingWithoutCallbackz&PagingTests.test_pagingWithoutCallbackì  s�   € ô .°4Ô8‰
ˆˆ1ˆ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                 óô  — | j                  «       }t        |d«      j                  «        t        | ¬«      \  }}}t	        |d«      }|j                  d|«       |j                  d«      }g }t        j                  |d«      j                  |j                  «       d}|s"|dkD  r|j                  «        |dz  }|s|dkD  rŒ|s| j                  d	«       | j                  d
j                  |d   «      d
d«       y)z@
        Test L{util.FilePager}, sending an empty file.
        Úwr§  NrÃ  r5  rÉ  r   rR   zgetAllPages timed outr)   r6  )r/  r)  Úcloser—   r#  rº  r»  r   r8  r_  r  rL   r˜  rX  r9  )	r%   ÚfilenameEmptyrÕ   r0  rL   Ú	pagerizerr®   rÐ  Úttls	            r'   Útest_emptyFilePagingz PagingTests.test_emptyFilePagingû  sÜ   € ð Ÿ™›ˆÜˆ]˜CÓ ×&Ñ&Ô(Ü-°4Ô8‰
ˆˆ1ˆ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                 ó.  — t        | ¬«      \  }}}t        | j                  t        dd¬«      }|j	                  d|«       |j                  d«      }g }t        j                  |d«      j                  |j                  «       |s|j                  «        |sŒ| j                  dj                  |d   «      t        d	«       | j                  t        d
d«       | j                  t        ddid«       | j                  |j                   j"                  g «       y)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é	   r4  rÃ  r5  r)   r   r6  )rF  r7  rË   N)r—   r#  r%  r  rº  r»  r   r8  r_  r  rL   rX  r9  r  r  r  r*  Úchunks©r%   rÕ   r0  rL   rB  r®   rÐ  s          r'   Útest_filePagingWithCallbackz'PagingTests.test_filePagingWithCallback  sê   € ô
 .°4Ô8‰
ˆˆ1ˆ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                 óÀ  — t        | ¬«      \  }}}t        | j                  d«      }|j                  d|«       |j	                  d«      }g }t        j                  |d«      j                  |j                  «       |s|j                  «        |sŒ| j                  dj                  |d   «      t        d«       | j                  |j                  j                  g «       y)z<
        Test L{util.FilePager} without a callback.
        r§  NrÃ  r5  r)   r   r6  )r—   r#  r%  rº  r»  r   r8  r_  r  rL   rX  r9  r  r*  rH  rI  s          r'   Útest_filePagingWithoutCallbackz*PagingTests.test_filePagingWithoutCallback%  sµ   € ô .°4Ô8‰
ˆˆ1ˆdÜ! $§-¡-°Ó6ˆ	Ø	×Ñ˜% Ô+Ø�O‰O˜EÓ"ˆØˆÜ×Ñ˜˜JÓ'×3Ñ3°A·H±HÔ=ÙØ�I‰IŒKò à×ÑØ�H‰H�Q�q‘T‹NœIÐ'Pô	
ð 	×Ñ˜Ÿ™×/Ñ/°Õ4r)   N)
r*   r+   r,   r3   rQ  r;  r=  rD  rJ  rL  r-   r)   r'   r,  r,  Ë  s&   „ ñòò
ò(
òYò(5ó,5r)   r,  c                   ó   — e Zd Zd„ Zy)ÚDumbPublishablec                 ó
   — ddiS )Nr  rR   r-   r1   s    r'   ÚgetStateToPublishz!DumbPublishable.getStateToPublish8  s   € Ø" AÐ&Ð&r)   N)r*   r+   r,   rP  r-   r)   r'   rN  rN  7  s   „ ó'r)   rN  c                   ó   — e Zd Zd„ Zy)ÚDumbPubc                 ó   — d| _         y r›   )r  r1   s    r'   Ú	activatedzDumbPub.activated=  s
   € ØˆÕr)   N)r*   r+   r,   rT  r-   r)   r'   rR  rR  <  s   „ ó r)   rR  c                   ó   — e Zd Zd„ Zd„ Zy)r  c                 ó$   — t        d«      | _        y )NÚTESTING)rN  Úpubr1   s    r'   rG   zGetPublisher.__init__B  s   € Ü" 9Ó-ˆ�r)   c                 ó   — | j                   S r0   )rX  r1   s    r'   Úremote_getPubzGetPublisher.remote_getPubE  s   € Ø�x‰xˆr)   N)r*   r+   r,   rG   rZ  r-   r)   r'   r  r  A  s   „ ò.ór)   r  c                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚDisconnectionTestsz'
    Test disconnection callbacks.
    c                 ó   — t        d|› �«      ‚)NzI shouldn't have been called: ©rÁ   )r%   r  s     r'   r™  zDisconnectionTests.errorQ  s   € ÜÐ;¸D¸6ÐBÓCÐCr)   c                 ó   — d| _         y)z.
        Called on broker disconnect.
        rR   N)ÚgotCallbackr1   s    r'   ÚgotDisconnectedz"DisconnectionTests.gotDisconnectedT  s   € ð ˆÕr)   c                 óJ   — | j                  || j                  «       d| _        y)z7
        Called on RemoteReference disconnect.
        rR   N)rX  ÚremoteObjectÚobjectCallback©r%   Úos     r'   ÚobjectDisconnectedz%DisconnectionTests.objectDisconnectedZ  s"   € ð 	×Ñ˜˜D×-Ñ-Ô.ØˆÕr)   c                 óZ  — t        | ¬«      \  }}}|j                  «        |j                  dt        «       «       |j	                  d«      }g }|j                  dt        «       «      j                  |j                  «       |j                  «        | j                  t        |«      d«       y )Nr§  rf  Ú
setBadCopyrR   )r—   rL   rº  Ú
BadCopySetr»  rá   ÚBadCopyablerò  r  rN   rX  rÏ  )r%   rÕ   r0  rL   ÚgrÐ  s         r'   Útest_badSerializationz(DisconnectionTests.test_badSerializationa  s|   € Ü-°4Ô8‰
ˆˆ1ˆdØ�	‰	ŒØ	×Ñ˜#œz›|Ô,Ø�O‰O˜CÓ ˆØˆØ	�‰�\¤;£=Ó1×<Ñ<¸Q¿X¹XÔFØ�
‰
ŒØ×Ñœ˜Q› Õ#r)   c                 óä  — t        | ¬«      \  }}}|j                  «        |j                  dt        «       «       |j	                  d«      }|j                  «        |j                  «        |j                  «        |j                  | j                  «       | j                  | j                  |j                  «       |j                  | j                  «       | j                  | j                  |j                  «       |j                  | j                  «       | j                  |j                  |j                  «       | j                  | j                  |j                  «       |j                  | j                  «       | j                  |j                  |j                  «       | j                  | j                  |j                  «       |j                  | j                  «       |j                  | j                  «       || _        |j!                  t#        j$                  t&        j(                  «      «       | j+                  | j,                  «       | j+                  | j.                  «       y )Nr§  rf  )r—   rL   rº  r™   r»  ÚnotifyOnDisconnectr™  rå  ÚdisconnectsÚdontNotifyOnDisconnectrë  Ú_disconnectedÚdisconnectCallbacksra  rg  rc  r`   r   ra   r   rb   rÎ  r`  rd  )r%   rÕ   r0  rL   Úrs        r'   Útest_disconnectionz%DisconnectionTests.test_disconnectionk  s¥  € Ü-°4Ô8‰
ˆˆ1ˆ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)   N)	r*   r+   r,   r3   r™  ra  rg  rm  ru  r-   r)   r'   r\  r\  L  s!   „ ñòDòò ò$ó!-r)   r\  c                   ó   — e Zd Zy)ÚFreakOutNr¶   r-   r)   r'   rw  rw  �  r·   r)   rw  c                   ó   — e Zd Zd„ Zy)rk  c                 ó   — t        «       ‚r0   )rw  )r%   Úps     r'   ÚgetStateToCopyForzBadCopyable.getStateToCopyFor”  s
   € Ü‹jÐr)   N)r*   r+   r,   r{  r-   r)   r'   rk  rk  “  s   „ ór)   rk  c                   ó   — e Zd Zd„ Zy)rj  c                  ó   — y r0   r-   )r%   Úbcs     r'   Úremote_setBadCopyzBadCopySet.remote_setBadCopy™  s   € Ør)   N)r*   r+   r,   r  r-   r)   r'   rj  rj  ˜  s   „ ór)   rj  c                   ó$   — e Zd ZdZd„ Zdd„Zd„ Zy)ÚLocalRemoteTestr   c                 ó   — |dz   S r›   r-   )r%   r®   s     r'   Ú	sync_add1zLocalRemoteTest.sync_add1   ó   € Ø�1‰uˆr)   c                 ó   — ||z   S r0   r-   )r%   r®   r¯   s      r'   Ú	async_addzLocalRemoteTest.async_add£  r„  r)   c                 ó   — t        «       ‚r0   r^  r1   s    r'   Ú
async_failzLocalRemoteTest.async_fail¦  s
   € Ü‹nÐr)   N)r   rR   )r*   r+   r,   ÚreportAllTracebacksrƒ  r†  rˆ  r-   r)   r'   r�  r�  �  s   „ ØÐòóór)   r�  c                   ó6   — e Zd ZdZdxZZd„ Zd„ Zd„ Zd„ Z	d„ Z
y)	ÚMyPerspectivezÃ
    @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                 ó   — || _         y r0   ©r;   ©r%   r;   s     r'   rG   zMyPerspective.__init__¶  s	   € Ø ˆ�r)   c                 ó   — | j                   S )zT
        Return the avatar identifier which was used to access this avatar.
        r�  r1   s    r'   Úperspective_getAvatarIdz%MyPerspective.perspective_getAvatarId¹  s   € ð �}‰}Ðr)   c                 ó   — t        «       S r0   )ÚMyViewr1   s    r'   Úperspective_getViewPointz&MyPerspective.perspective_getViewPoint¿  s	   € Ü‹xˆr)   c                 ó   — ||z   S )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_addzMyPerspective.perspective_addÂ  s   € ð �1‰uˆr)   c                 ó   — d| _         y ©NT©Ú	loggedOutr1   s    r'   ÚlogoutzMyPerspective.logoutÊ  ó	   € Øˆ�r)   N)r*   r+   r,   r3   ÚloggedInr™  rG   r�  r“  r•  rš  r-   r)   r'   r‹  r‹  ª  s,   „ ñð !Ð €Hˆyò!òòòór)   r‹  c                   ó   — e Zd ZdZeZdZd„ Zy)Ú	TestRealmaº  
    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                 óF  — |t         j                  k(  sJ ‚|dk(  sJ ‚|t        j                  u rt         j                  t	        «       d„ fS | j                  |«      | _        d| j                  _        t         j                  | j                  | j                  j                  fS )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                   ó   — y r0   r-   r-   r)   r'   r8   z)TestRealm.requestAvatar.<locals>.<lambda>è  r9   r)   T)	r   r:   r   Ú	ANONYMOUSr=  ÚperspectiveFactoryÚlastPerspectiverœ  rš  )r%   r;   r<   Ú	interfaces       r'   r?   z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,   r3   r‹  r£  r¤  r?   r-   r)   r'   rž  rž  Î  s   „ ñ
ð 'Ðà€OóXr)   rž  c                   ó   — e Zd Zd„ Zy)r’  c                 ó"   — t        |t        «      S r0   )r"   r‹  r$   s     r'   Ú
view_checkzMyView.view_checkð  s   € Ü˜$¤Ó.Ð.r)   N)r*   r+   r,   r¨  r-   r)   r'   r’  r’  ï  s   „ ó/r)   r’  c                   ó   — e Zd ZdZd„ Zd„ Zy)Ú
LeakyRealmz]
    A realm which hangs onto a reference to the mind object in its logout
    function.
    c                 ó   — || _         y)z˜
        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'   rG   zLeakyRealm.__init__ú  s   € ð $ˆ�r)   c                 óx   ‡‡— | j                  ‰«       | j                  |«      Št        j                  ‰ˆˆfd„fS )Nc                  ó(   •— ‰ ‰j                  «       fS r0   )rš  )r<   Úpersps   €€r'   r8   z*LeakyRealm.requestAvatar.<locals>.<lambda>  s   ø€ °°u·|±|³~Ð0F€ r)   )r¬  r£  r   r:   )r%   r;   r<   r¥  r°  s     ` @r'   r?   zLeakyRealm.requestAvatar  s1   ù€ Ø�‰˜ÔØ×'Ñ'¨Ó1ˆÜ—‘ Ô(FÐGÐGr)   N)r*   r+   r,   r3   rG   r?   r-   r)   r'   rª  rª  ô  s   „ ñò
$óHr)   rª  c                   ó   — e Zd ZdZd„ Zy)ÚNewCredLeakTestsz/
    Tests to try to trigger memory leaks.
    c                 ó¦  ‡ ‡‡‡	— d‰ _         ˆ fd„}t        ‰ t        |«      ¬«      \  }Š	Šg Š|j                  d«      }|j	                  dd«      }d„ }|j                  |«       ˆˆˆ	fd„}|j                  |«       ‰j                  «        ‰ j                  ‰d	g«       t        j                  «        ‰ j                  ‰ j                  «       «       y)
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                 ó:   •— t        j                  | «      ‰_        y r0   )ÚweakrefrP  ÚmindRef)r<   r%   s    €r'   Ú
setMindRefz4NewCredLeakTests.test_logoutLeak.<locals>.setMindRef  s   ø€ Ü"Ÿ;™; tÓ,ˆD�Lr)   )rp   r•   rv  Úloginr�   c                 ón   — | \  }}t        «       }|j                  dt        j                  |d«      |«      S )NÚrespondr�   )r™   rá   r   rº  )r®   Ú	challengeÚ
challengerr<   s       r'   Ú
cbResponsez4NewCredLeakTests.test_logoutLeak.<locals>.cbResponse$  s8   € Ø$%Ñ!ˆI�zÜ“>ˆDØ×(Ñ(Øœ2Ÿ:™: i°Ó:¸Dóð r)   c                 ó¢   •— ‰j                  «        ‰j                  d«       ‰j                  t        j                  t        d«      «      «       y )NrR   Úboom)rP   r  r`   r   ra   rÁ   )Ú_ÚconnectionBrokenrL   rt   s    €€€r'   r`   z8NewCredLeakTests.test_logoutLeak.<locals>.connectionLost-  s6   ø€ Ø�I‰IŒKØ×#Ñ# AÔ&Ø×'Ñ'¬¯©¼ÀVÓ8LÓ(MÕNr)   rR   )r¶  r—   rª  r»  rá   r_  rN   rX  ré  rê  r÷  )
r%   r·  rs   rv  r$  r½  r`   rÁ  rL   rt   s
   `      @@@r'   Útest_logoutLeakz NewCredLeakTests.test_logoutLeak  s»   û€ ð ˆŒô	-ô ,DØœZ¨
Ó3ô,
Ñ(ˆ�l Dð
 ÐØ×)Ñ)¨&Ó1ˆØ�O‰O˜G XÓ.ˆò	ð 	
�‰�jÔ!ö	Oð
 	
�‰�nÔ%ð 	�
‰
ŒØ×ÑÐ)¨A¨3Ô/ô
 	�
‰
ŒØ×Ñ˜$Ÿ,™,›.Õ)r)   N)r*   r+   r,   r3   rÂ  r-   r)   r'   r²  r²  	  s   „ ñó.*r)   r²  c                   ó°   — e Zd ZdZd„ Zdd„Z ej                  ej                  «      fd„Z
d„ Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚNewCredTestsz=
    Tests related to the L{twisted.cred} support in PB.
    c                 óÐ   — t        «       | _        t        j                  | j                  «      | _        t	        | j                  «      | _        t        j                  «       | _        y)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“   rs  rq   r   r”   ri   r1   s    r'   rQ  zNewCredTests.setUpD  sC   € ô “[ˆŒ
Ü—m‘m D§J¡JÓ/ˆŒÜ:¸4¿;¹;ÓGˆÔÜ×/Ñ/Ó1ˆÕr)   Nc                 óP  — t        | | j                  | j                  «      \  | _        | _        | _        t        «       | _        t        t        j                  ddd«      | j                  «      | _        | j                  j                  «       j                  | j                  «       y)aæ  
        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}
        ÚTCPr]   iá  N)rw   ri   rq   rC   rD   rL   ry   ÚconnectorStater…   r   ÚIPv4Addressrf   r   r_  ÚestablishClientAndServer)r%   Ú_ignoreds     r'   rÊ  z%NewCredTests.establishClientAndServerO  s‡   € ô, /EØ�$×$Ñ$ d×&8Ñ&8ó/
Ñ+ˆŒ�T”[ $¤)ô >Ó?ˆÔÜ3Ü×Ñ  {°DÓ9¸4×;NÑ;Nó
ˆŒð 	×Ñ×+Ñ+Ó-×9Ñ9¸$×:WÑ:WÕXr)   c                 óä   — | j                  | j                  j                  j                  «       | j                  j	                  |«       | j
                  j                  | j                  |«       y)aŒ  
        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Î  rC   rV   rÍ  r`   ri   rh   rf   )r%   rg   s     r'   ÚcompleteClientLostConnectionz)NewCredTests.completeClientLostConnectiono  sN   € ð 	�‰˜Ÿ™×-Ñ-×4Ñ4Ô5ð 	�‰×"Ñ" 6Ô*Ø×Ñ×/Ñ/°·±ÀÕGr)   c                 ó´   ‡ — ‰ j                  «        ‰ j                  j                  «       }ˆ fd„}ˆ fd„}|j                  |«       |j                  |«       |S )z¶
        Assert that L{PBClientFactory.getRootObject}'s Deferred fires with
        a L{RemoteReference}, and that disconnecting it runs its
        disconnection callbacks.
        c                 óH   •— ‰j                  | t        j                  «       | S r0   )rW  r   ÚRemoteReference)ÚrootObjr%   s    €r'   ÚgotRootObjectz6NewCredTests.test_getRootObject.<locals>.gotRootObjectŒ  s   ø€ Ø×!Ñ! '¬2×+=Ñ+=Ô>ØˆNr)   c                 ó¦   •— t        «       }| j                  |j                  «       ‰j                  j	                  «        ‰j                  «        |S r0   )r   ro  r‚   ri   Ú
disconnectrÍ  )rÑ  ÚdisconnectedDeferredr%   s     €r'   rÔ  z3NewCredTests.test_getRootObject.<locals>.disconnect�  sD   ø€ Ü#+£:Ð Ø×&Ñ&Ð';×'DÑ'DÔEØ×Ñ×)Ñ)Ô+à×-Ñ-Ô/à'Ð'r)   ©rÊ  ri   rO  r_  )r%   ÚrootObjDeferredrÒ  rÔ  s   `   r'   Útest_getRootObjectzNewCredTests.test_getRootObjectƒ  sS   ø€ ð 	×%Ñ%Ô'Ø×,Ñ,×:Ñ:Ó<ˆô	ô	(ð 	×#Ñ# MÔ2Ø×#Ñ# JÔ/àÐr)   c                 ó„   ‡ — ‰ j                  «        ‰ j                  j                  «       }ˆ fd„}|j                  |«      S )z“
        Test that when a connection is lost, calling a method on a
        RemoteReference obtained from it raises L{DeadReferenceError}.
        c                 óÖ   •‡ — t        «       }‰ j                  |j                  «       ˆ ˆfd„}|j                  |«       ‰j                  j                  «        ‰j                  «        |S )Nc                 ó\   •— ‰j                  t        j                  ‰j                  d«       y )NÚmethod)ÚassertRaisesr   ÚDeadReferenceErrorrá   )ÚignrÑ  r%   s    €€r'   ÚlostConnectionzSNewCredTests.test_deadReferenceError.<locals>.gotRootObject.<locals>.lostConnectionª  s!   ø€ Ø×!Ñ!¤"×"7Ñ"7¸×9KÑ9KÈXÕVr)   )r   ro  r‚   r_  ri   rÔ  rÍ  )rÑ  rÕ  rà  r%   s   `  €r'   rÒ  z;NewCredTests.test_deadReferenceError.<locals>.gotRootObject¦  sZ   ù€ Ü#+£:Ð Ø×&Ñ&Ð';×'DÑ'DÔEõWð !×,Ñ,¨^Ô<Ø×Ñ×)Ñ)Ô+à×-Ñ-Ô/à'Ð'r)   rÖ  )r%   r×  rÒ  s   `  r'   Útest_deadReferenceErrorz$NewCredTests.test_deadReferenceErrorž  s=   ø€ ð
 	×%Ñ%Ô'Ø×,Ñ,×:Ñ:Ó<ˆô	(ð ×*Ñ*¨=Ó9Ð9r)   c                 óÎ   ‡ —  G d„ dt         j                  «      } |«       ‰ _        ‰ j                  «        ‰ j                  j	                  «       }ˆ fd„}|j                  |«      S )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                   ó   — e Zd ZdZd„ Zy)ú=NewCredTests.test_clientConnectionLost.<locals>.ReconnectOnceFc                 ó–   — | j                    }d| _         t        j                  j                  | |||«      }|r|j	                  «        |S r—  )ÚreconnectedAlreadyr   r”   rh   rŒ   )r%   rf   rg   Úreconnectingrž  s        r'   rh   zRNewCredTests.test_clientConnectionLost.<locals>.ReconnectOnce.clientConnectionLostÀ  sM   € Ø#'×#:Ñ#:Ð:�Ø*.�Ô'Ü×+Ñ+×@Ñ@Ø˜) V¨\ó�ñ  Ø×%Ñ%Ô'Ø�r)   N)r*   r+   r,   ræ  rh   r-   r)   r'   ÚReconnectOncerä  ½  s   „ Ø!&Ðór)   rè  c                 ó  •— ‰j                  | t        j                  «       t        «       }| j	                  |j
                  «       ‰j                  j                  «        ‰j                  «        ˆfd„}|j                  |«      S )Nc                 ód   •— ‰j                   j                  «       }ˆfd„}|j                  |«      S )Nc                 óæ   •— ‰j                  | t        j                  «       t        «       }| j	                  |j
                  «       ‰j                  j                  «        ‰j                  «        |S r0   )	rW  r   rÐ  r   ro  r‚   ri   rÔ  rÍ  )ÚanotherRootObjr$  r%   s     €r'   ÚgotAnotherRootObjectzqNewCredTests.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)   )ri   rO  r_  )rß  r$  rí  r%   s      €r'   r_   zSNewCredTests.test_clientConnectionLost.<locals>.gotRootObject.<locals>.disconnectedØ  s.   ø€ Ø×&Ñ&×4Ñ4Ó6�ôð —}‘}Ð%9Ó:Ð:r)   )
rW  r   rÐ  r   ro  r‚   ri   rÔ  rÍ  r_  )rÑ  r$  r_   r%   s      €r'   rÒ  z=NewCredTests.test_clientConnectionLost.<locals>.gotRootObjectÏ  sf   ø€ Ø×!Ñ! '¬2×+=Ñ+=Ô>ä“
ˆAØ×&Ñ& q§z¡zÔ2à×Ñ×)Ñ)Ô+Ø×-Ñ-Ô/ô;ð —=‘= Ó.Ð.r)   )r   r”   ri   rÊ  rO  r_  )r%   rè  r×  rÒ  s   `   r'   Útest_clientConnectionLostz&NewCredTests.test_clientConnectionLost¶  sY   ø€ ô	œB×.Ñ.ô 	ñ +›_ˆÔØ×%Ñ%Ô'à×,Ñ,×:Ñ:Ó<ˆô	/ð0 ×*Ñ*¨=Ó9Ð9r)   c                 ó  — | j                  «        | j                  j                  d«      }|j                  t	        j
                  t        «       «      «       |j                  t        j                  t        j                  «      «       y)z”
        Test that if a Broker loses its connection without receiving any bytes,
        it doesn't raise any exceptions or log any errors.
        )r]   i90  N)rÊ  rq   rk   rm   r   rn   rl   r`   r   ra   r   rb   )r%   ÚserverProtos     r'   Útest_immediateClosez NewCredTests.test_immediateCloseé  s_   € ð
 	×%Ñ%Ô'Ø×(Ñ(×6Ñ6Ð7KÓLˆØ×"Ñ"¤8×#7Ñ#7¼»
Ó#CÔDØ×"Ñ"¤7§?¡?´4×3GÑ3GÓ#HÕIr)   c                 óü   — t        j                  «       }|j                  t        j                  dd«      «      }|j                  dt        j                  t        d«      «      «       | j                  |t        «      S )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”   r¸  r	   ÚUsernamePasswordÚclientConnectionFailedr   ra   r   ÚassertFailure)r%   ri   ÚloginDeferreds      r'   Útest_loginConnectionRefusedz(NewCredTests.test_loginConnectionRefusedó  sp   € ô ×*Ñ*Ó,ˆØ%×+Ñ+Ü×(Ñ(¨°Ó8ó
ˆð 	×,Ñ,ØÜ�O‰OÜ&Ð'JÓKóô	
ð ×!Ñ! -Ô1GÓHÐHr)   c                 ó<  ‡ ‡— ‰ j                   j                  t        j                  d¬«      «       t	        j
                  dd«      }d}t        «       Š‰ j                  j                  ||«      }ˆˆ fd„}ˆ fd„}|j                  |«       |j                  |«       ˆ fd„}|j                  |«       ‰ j                  «        ‰ j                  j                  «        t        j                  «        ‰ j                  j                  «        ‰j                  d«       |S )	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                 ó¦   •— ‰j                  ‰j                  j                  j                  «       ‰j	                  | t
        j                  «       ‰S r0   )rÎ  r•   r¤  rœ  rW  r   rÐ  )rå   ÚloginCompletedr%   s    €€r'   ÚcbLoginz.NewCredTests.test_loginLogout.<locals>.cbLogin  s;   ø€ Ø�O‰O˜DŸJ™J×6Ñ6×?Ñ?Ô@Ø×!Ñ! +¬r×/AÑ/AÔBØ!Ð!r)   c                 óZ   •— ‰j                   j                  «        ‰j                  «        y r0   )ri   rÔ  rÍ  ©Úignoredr%   s    €r'   ÚcbDisconnectz3NewCredTests.test_loginLogout.<locals>.cbDisconnect  s!   ø€ Ø×Ñ×)Ñ)Ô+Ø×-Ñ-Õ/r)   c                 ód   •— ‰j                  ‰j                  j                  j                  «       y r0   )rÎ  r•   r¤  r™  r  s    €r'   ÚcbLogoutz/NewCredTests.test_loginLogout.<locals>.cbLogout&  s   ø€ Ø�O‰O˜DŸJ™J×6Ñ6×@Ñ@ÕAr)   N)r
   ÚregisterCheckerr   r‘   r	   rõ  r   ri   r¸  r_  rÊ  rL   rN   ré  rê  r‚   )r%   Úcredsr<   r$  r   r  r  rÿ  s   `      @r'   Útest_loginLogoutzNewCredTests.test_loginLogout  sÝ   ù€ ð
 	�‰×#Ñ#Ü×<Ñ<À'ÔJô	
ô ×,Ñ,¨W°gÓ>ˆð ˆä!›ˆà×Ñ×$Ñ$ U¨DÓ1ˆõ	"ô
	0ð 	
�‰�gÔØ	�‰�lÔ#ô	Bð 	
�‰�hÔà×%Ñ%Ô'Ø�	‰	�‰Ôô 	�
‰
Œà�	‰	�‰Ôà×Ñ Ô%Øˆr)   c                 ó<  ‡ ‡— t        «       Š G ˆfd„dt        j                  «      }|‰ j                  _        ‰ j
                  j                  t        j                  d¬«      «       ‰ j                  j                  t        j                  dd«      d«      }ˆfd„}|j                  |«       ˆ fd„}|j                  |«       ‰ j                  «        ‰ j                  j!                  «        t#        j$                  «        ‰ j                  j!                  «        |S )	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                   ó"   •— e Zd ZdZd„ Zˆ fd„Zy)ú=NewCredTests.test_logoutAfterDecref.<locals>.EventPerspectivezQ
            An avatar which fires a Deferred when it is logged out.
            c                  ó   — y r0   r-   rŽ  s     r'   rG   zFNewCredTests.test_logoutAfterDecref.<locals>.EventPerspective.__init__C  s   € Ør)   c                 ó(   •— ‰j                  d «       y r0   )r‚   )r%   r™  s    €r'   rš  zDNewCredTests.test_logoutAfterDecref.<locals>.EventPerspective.logoutF  s   ø€ Ø×"Ñ" 4Õ(r)   N)r*   r+   r,   r3   rG   rš  r˜  s   €r'   ÚEventPerspectiver  >  s   ø„ ñòõ)r)   r  rô  rî   ró  r   c                 ó   •— ‰S r0   r-   )Úavatarr™  s    €r'   Ú
cbLoggedInz7NewCredTests.test_logoutAfterDecref.<locals>.cbLoggedInS  s   ø€ ð Ðr)   c                 óf   •— ‰j                  ‰j                  j                  j                  i «       y r0   )rX  rq   rx  Ú_localCleanupr  s    €r'   ÚcbLoggedOutz8NewCredTests.test_logoutAfterDecref.<locals>.cbLoggedOutZ  s(   ø€ ð ×Ñ˜T×/Ñ/×@Ñ@×NÑNÐPRÕSr)   )r   r   ÚAvatarr•   r£  r
   r  r   r‘   ri   r¸  r	   rõ  r_  rÊ  rL   rN   ré  rê  )r%   r  r$  r  r  r™  s   `    @r'   Útest_logoutAfterDecrefz#NewCredTests.test_logoutAfterDecref6  sÕ   ù€ ô “Jˆ	ö		)œrŸy™yô 		)ð )9ˆ�
‰
Ô%à�‰×#Ñ#Ü×<Ñ<ÀÔHô	
ð ×Ñ×$Ñ$Ü×(Ñ(¨°Ó8¸)ó
ˆô	ð
 	
�‰�jÔ!ô	Tð
 	
�‰�kÔ"à×%Ñ%Ô'ð 	�	‰	�‰Ôô 	�
‰
Œà�	‰	�‰ÔØˆr)   c                 óê  ‡ — ‰ j                   j                  t        j                  dd¬«      «       ‰ j                  j                  t        j                  dd«      d«      }‰ j                  j                  t        j                  dd«      d«      }t        ||g«      }d„ }|j                  |«       ˆ fd„}|j                  |«       ‰ j                  «        ‰ j                  j                  «        |S )	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                 ób   — | \  }}t        |j                  d«      |j                  d«      g«      S )NÚgetAvatarId)r   rá   )rž  ÚfirstÚseconds      r'   r  z5NewCredTests.test_concurrentLogin.<locals>.cbLoggedIn}  s6   € Ø$‰OˆU�FÜ Ø×!Ñ! -Ó0°&×2CÑ2CÀMÓ2RÐSóð r)   c                 óX   •— | \  }}‰j                  |d«       ‰j                  |d«       y )Nró  r  )rX  )r®   r  r  r%   s      €r'   ÚcbAvatarIdsz6NewCredTests.test_concurrentLogin.<locals>.cbAvatarIds…  s,   ø€ Ø‰MˆE�6Ø×Ñ˜U FÔ+Ø×Ñ˜V VÕ,r)   )r
   r  r   r‘   ri   r¸  r	   rõ  r   r_  rÊ  rL   rN   )r%   Ú
firstLoginÚsecondLoginr$  r  r   s   `     r'   Útest_concurrentLoginz!NewCredTests.test_concurrentLoginl  sÑ   ø€ ð
 	�‰×#Ñ#Ü×<Ñ<ÀÈWÔUô	
ð ×'Ñ'×-Ñ-Ü×(Ñ(¨°Ó8¸)ó
ˆ
ð ×(Ñ(×.Ñ.Ü×(Ñ(¨°Ó9¸9ó
ˆô ˜: {Ð3Ó4ˆò	ð 	
�‰�jÔ!ô	-ð
 	
�‰�kÔ"à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr)   c                 ó  ‡ — ‰ j                   j                  t        j                  d¬«      «       ‰ j                  j                  t        j                  dd«      «      }‰ j                  j                  t        j                  dd«      «      }‰ j                  |t        «       ‰ j                  |t        «       t        ||g«      }ˆ fd„}|j                  |«       ‰ j                  «        ‰ j                  j                  «        |S )zz
        Test that a login attempt with an invalid user or invalid password
        fails in the appropriate way.
        rû  rü  s
   nosuchuserrý  s	   wrongpassc                 óf   •— ‰j                  t        «      }‰j                  t        |«      d«       y )NrÚ   )ÚflushLoggedErrorsr   rX  rÏ  ©ÚignoreÚerrorsr%   s     €r'   Úcleanupz;NewCredTests.test_badUsernamePasswordLogin.<locals>.cleanup¥  s(   ø€ Ø×+Ñ+Ô,=Ó>ˆFØ×ÑœS ›[¨!Õ,r)   )r
   r  r   r‘   ri   r¸  r	   rõ  r÷  r   r   r_  rÊ  rL   rN   )r%   r!  r"  r$  r*  s   `    r'   Útest_badUsernamePasswordLoginz*NewCredTests.test_badUsernamePasswordLogin‘  sÚ   ø€ ð
 	�‰×#Ñ#Ü×<Ñ<À'ÔJô	
ð ×'Ñ'×-Ñ-Ü×(Ñ(¨¸Ó@ó
ˆ
ð ×(Ñ(×.Ñ.Ü×(Ñ(¨°,Ó?ó
ˆð 	×Ñ˜:Ô'8Ô9Ø×Ñ˜;Ô(9Ô:Ü˜: {Ð3Ó4ˆô	-ð 	
�‰�gÔà×%Ñ%Ô'Ø�	‰	�‰Ôàˆr)   c                 óp  — | j                   j                  t        j                  «       «       | j                  j                  t        j                  «       d«      }d„ }|j                  |«       |j                  | j                  d«       | j                  «        | j                  j                  «        |S )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                 ó&   — | j                  dd«      S ©NrU  é{   r²  ©rå   s    r'   r  z4NewCredTests.test_anonymousLogin.<locals>.cbLoggedIn¹  ó   € Ø×)Ñ)¨&°#Ó6Ð6r)   r/  )r
   r  r   ÚAllowAnonymousAccessri   r¸  r	   Ú	Anonymousr_  rX  rÊ  rL   rN   )r%   r$  r  s      r'   Útest_anonymousLoginz NewCredTests.test_anonymousLogin°  s†   € ð 	�‰×#Ñ#¤H×$AÑ$AÓ$CÔDØ×Ñ×$Ñ$¤[×%:Ñ%:Ó%<¸iÓHˆò	7ð 	
�‰�jÔ!à	�‰�d×&Ñ&¨Ô,à×%Ñ%Ô'Ø�	‰	�‰ÔØˆr)   c                 ón  ‡ — ‰ j                   j                  t        j                  d¬«      «       ‰ j                  j                  t        j                  «       d«      }‰ j                  |t        «       ˆ fd„}|j                  |«       ‰ j                  «        ‰ j                  j                  «        |S )zg
        Verify that without an anonymous checker set up, anonymous login is
        rejected.
        Úpassrü  r   c                 óf   •— ‰j                  t        «      }‰j                  t        |«      d«       y r›   )r&  r   rX  rÏ  r'  s     €r'   r*  z=NewCredTests.test_anonymousLoginNotPermitted.<locals>.cleanupÏ  s(   ø€ Ø×+Ñ+Ô,@ÓAˆFØ×ÑœS ›[¨!Õ,r)   )r
   r  r   r‘   ri   r¸  r	   r3  r÷  r   r_  rÊ  rL   rN   )r%   r$  r*  s   `  r'   Útest_anonymousLoginNotPermittedz,NewCredTests.test_anonymousLoginNotPermittedÄ  s‹   ø€ ð
 	�‰×#Ñ#Ü×<Ñ<À&ÔIô	
ð ×Ñ×$Ñ$¤[×%:Ñ%:Ó%<¸iÓHˆØ×Ñ˜1Ô2Ô3ô	-ð 	
�‰�gÔà×%Ñ%Ô'Ø�	‰	�‰Ôàˆr)   c                 óÎ  — | j                   j                  t        j                  «       «       | j                   j                  t        j                  d¬«      «       | j
                  j                  t        j                  «       d«      }d„ }|j                  |«       |j                  | j                  d«       | j                  «        | j                  j                  «        |S )z„
        Like L{test_anonymousLogin} but against a portal with a checker for
        both IAnonymous and IUsernamePassword.
        rû  rü  r   c                 ó&   — | j                  dd«      S r.  r²  r0  s    r'   r   zENewCredTests.test_anonymousLoginWithMultipleCheckers.<locals>.cbLoginå  r1  r)   r/  )r
   r  r   r2  r‘   ri   r¸  r	   r3  r_  rX  rÊ  rL   rN   ©r%   r$  r   s      r'   Ú'test_anonymousLoginWithMultipleCheckersz4NewCredTests.test_anonymousLoginWithMultipleCheckersÚ  s¨   € ð
 	�‰×#Ñ#¤H×$AÑ$AÓ$CÔDØ�‰×#Ñ#Ü×<Ñ<À'ÔJô	
ð ×Ñ×$Ñ$¤[×%:Ñ%:Ó%<¸iÓHˆò	7ð 	
�‰�gÔà	�‰�d×&Ñ&¨Ô,à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr)   c                 óÒ  — | j                   j                  t        j                  «       «       | j                   j                  t        j                  d¬«      «       | j
                  j                  t        j                  dd«      d«      }d„ }|j                  |«       |j                  | j                  d«       | j                  «        | j                  j                  «        |S )z€
        Like L{test_anonymousLoginWithMultipleCheckers} but check that
        username/password authentication works.
        rû  rü  rý  r   c                 ó(   — | j                  ddd«      S )NÚaddr  é   r²  r0  s    r'   r   zINewCredTests.test_authenticatedLoginWithMultipleCheckers.<locals>.cbLoginþ  s   € Ø×)Ñ)¨%°°bÓ9Ð9r)   r/  )r
   r  r   r2  r‘   ri   r¸  r	   rõ  r_  rX  rÊ  rL   rN   r;  s      r'   Ú+test_authenticatedLoginWithMultipleCheckersz8NewCredTests.test_authenticatedLoginWithMultipleCheckersñ  s¯   € ð
 	�‰×#Ñ#¤H×$AÑ$AÓ$CÔDØ�‰×#Ñ#Ü×<Ñ<À'ÔJô	
ð ×Ñ×$Ñ$Ü×(Ñ(¨°'Ó:¸Ió
ˆò	:ð 	
�‰�gÔà	�‰�d×&Ñ&¨Ô,à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr)   c                 óž  — | j                   j                  t        j                  d¬«      «       | j                  j                  t        j                  dd«      d«      }d„ }|j                  |«       d„ }|j                  |«       |j                  | j                  «       | j                  «        | j                  j                  «        |S )zb
        Verify that a viewpoint can be retrieved after authenticating with
        cred.
        rû  rü  rý  r   c                 ó$   — | j                  d«      S )NÚgetViewPointr²  r0  s    r'   r   z'NewCredTests.test_view.<locals>.cbLogin  s   € Ø×)Ñ)¨.Ó9Ð9r)   c                 ó$   — | j                  d«      S )Nrú   r²  )Ú	viewpoints    r'   ÚcbViewz&NewCredTests.test_view.<locals>.cbView  s   € Ø×'Ñ'¨Ó0Ð0r)   )r
   r  r   r‘   ri   r¸  r	   rõ  r_  rÎ  rÊ  rL   rN   )r%   r$  r   rG  s       r'   Ú	test_viewzNewCredTests.test_view
  s£   € ð
 	�‰×#Ñ#Ü×<Ñ<À'ÔJô	
ð ×Ñ×$Ñ$Ü×(Ñ(¨°'Ó:¸Ió
ˆò	:ð 	
�‰�gÔò	1ð 	
�‰�fÔà	�‰�d—o‘oÔ&à×%Ñ%Ô'Ø�	‰	�‰Ôàˆr)   r0   )r*   r+   r,   r3   rQ  rÊ  r   ra   r   rb   rÍ  rØ  rá  rî  rñ  rù  r	  r  r#  r+  r4  r8  r<  rA  rH  r-   r)   r'   rÄ  rÄ  ?  s{   „ ñò	2óYðB %�W—_‘_ T×%9Ñ%9Ó:óHò(ò6:ò01:òfJòIò$/òb4òl#òJò>ò(ò,ò.ó2r)   rÄ  c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚNonSubclassingPerspectivec                  ó   — y r0   r-   rŽ  s     r'   rG   z"NonSubclassingPerspective.__init__*  r£  r)   c                 ór   — |j                  || «      }|j                  || «      }|j                  |||f«      S r0   )ÚunserializeÚ	serialize)r%   rc   Úmessager  Úkwargss        r'   ÚperspectiveMessageReceivedz4NonSubclassingPerspective.perspectiveMessageReceived.  s>   € Ø×!Ñ! $¨Ó-ˆØ×#Ñ# F¨DÓ1ˆØ×Ñ ¨$°Ð 7Ó8Ð8r)   c                 ó   — d| _         y r—  r˜  r1   s    r'   rš  z NonSubclassingPerspective.logout4  r›  r)   N)r*   r+   r,   rG   rQ  rš  r-   r)   r'   rJ  rJ  (  s   „ òò9ór)   rJ  c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚNSPTestsz
    Tests for authentication against a realm where the L{IPerspective}
    implementation is not a subclass of L{Avatar}.
    c                 óŒ  — t        «       | _        t        | j                  _        t	        j
                  | j                  «      | _        t        j                  «       | _        | j                  j                  dd«       | j                  j                  | j                  «       t        t        j                  | j                  «      «      | _        t        j                   d| j                  d¬«      | _        | j%                  | j"                  j&                  «       | j"                  j)                  «       j"                  | _        y )Nrý  rû  r   r]   )r¥  )rž  r•   rJ  r£  r
   r“   r   r‘   r–   ÚaddUserr  r   r   r’   r„  r   r€  rƒ  ro   r‰  r‚  Úportnor1   s    r'   rQ  z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                 óT  ‡ ‡— t        j                  «       Š‰j                  t        j                  dd«      d«      }t        j                  d‰ j                  ‰«       |j                  d„ «       |j                  ‰ j                  dddd	if«       ˆˆ fd
„}|j                  |«       |S )z�
        An L{IPerspective} implementation which does not subclass
        L{Avatar} can expose remote methods for the client to call.
        rý  rû  r   r]   c                 ó*   — | j                  ddd¬«      S )NÚANYTHINGÚherer  )rÃ  r²  )rz  s    r'   r8   z#NSPTests.test_NSP.<locals>.<lambda>R  s   €  §¡¨Z¸ÀU Ó K€ r)   rZ  )r[  rÃ  r  c                 ó�   •— ‰j                  «        ‰j                  j                  D ]  }|j                  j	                  «        Œ y r0   )rÔ  r„  Ú	protocolsrV   rˆ  )r  rz  r„  r%   s     €€r'   r*  z"NSPTests.test_NSP.<locals>.cleanupU  s8   ø€ Ø×ÑÔ Ø—\‘\×+Ñ+ò -�Ø—‘×*Ñ*Õ,ñ-r)   )
r   r”   r¸  r	   rõ  r   r�  rW  r_  rX  )r%   r$  r*  r„  s   `  @r'   Útest_NSPzNSPTests.test_NSPJ  sŠ   ù€ ô
 ×$Ñ$Ó&ˆØ�M‰Mœ+×6Ñ6°wÀÓHÈ)ÓTˆÜ×Ñ˜;¨¯©°WÔ=Ø	�‰ÑKÔLØ	�‰�d×&Ñ&¨°YÀÈÀÐ(OÔPõ	-ð
 	
�‰�gÔØˆr)   N)r*   r+   r,   r3   rQ  r^  r-   r)   r'   rT  rT  8  s   „ ñò

/ór)   rT  c                   ó   — e Zd ZdZd„ Zd„ Zy)Ú
IForwardedzA
    Interface used for testing L{util.LocalAsyncForwarder}.
    c                   ó   — y)z,
        Simple synchronous method.
        Nr-   r-   r)   r'   Ú	forwardMezIForwarded.forwardMec  r9   r)   c                   ó   — y)z-
        Simple asynchronous method.
        Nr-   r-   r)   r'   ÚforwardDeferredzIForwarded.forwardDeferredh  r9   r)   N)r*   r+   r,   r3   rb  rd  r-   r)   r'   r`  r`  ^  s   „ ñòó
r)   r`  c                   ó*   — e Zd ZdZdZdZd„ Zd„ Zd„ Zy)Ú	ForwardedzÚ
    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                 ó   — d| _         y)z6
        Set a local flag to test afterwards.
        TN)Ú	forwardedr1   s    r'   rb  zForwarded.forwardMe|  s   € ð ˆ�r)   c                 ó   — d| _         y)zv
        Set a local flag to test afterwards. This should not be called as it's
        not in the interface.
        TN)Úunforwardedr1   s    r'   ÚdontForwardMezForwarded.dontForwardMe‚  s   € ð
  ˆÕr)   c                 ó   — t        d«      S )z0
        Asynchronously return C{True}.
        T)r   r1   s    r'   rd  zForwarded.forwardDeferred‰  s   € ô �t‹}Ðr)   N)	r*   r+   r,   r3   rh  rj  rb  rk  rd  r-   r)   r'   rf  rf  n  s"   „ ñð €IØ€Kòò ór)   rf  c                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚSpreadUtilTestsz+
    Tests for L{twisted.spread.util}.
    c                 ó\   — t        «       }| j                  |j                  dd«      d«       y)zk
        Call a synchronous method of a L{util.LocalAsRemote} object and check
        the result.
        Úadd1rÚ   rÛ   N)r�  rX  rá   re  s     r'   Ú	test_synczSpreadUtilTests.test_sync•  s'   € ô
 ÓˆØ×Ñ˜Ÿ™ f¨aÓ0°!Õ4r)   c                 óº   — t        «       }t        «       }|j                  ddd¬«      }| j                  |t        «       |j	                  | j
                  d«       |S )zm
        Call an asynchronous method of a L{util.LocalAsRemote} object and check
        the result.
        r?  rÚ   rß   )r¯   rß  )r�  rá   rW  r   r_  rX  )r%   rf  r$  s      r'   Ú
test_asynczSpreadUtilTests.test_async�  sQ   € ô
 ÓˆÜÓˆØ�L‰L˜  QˆLÓ'ˆØ×Ñ˜a¤Ô*Ø	�‰�d×&Ñ&¨Ô*Øˆr)   c                 ór   ‡ — t        «       }|j                  d«      }ˆ fd„}|j                  ˆ fd„|«       |S )zG
        Test an asynchronous failure on a remote method call.
        r˜  c                 óp   •— ‰j                  | t        j                  «       | j                  t        «       y r0   )rW  r   ra   ÚtraprÁ   )r1  r%   s    €r'   Úebz*SpreadUtilTests.test_asyncFail.<locals>.eb°  s#   ø€ Ø×!Ñ! !¤W§_¡_Ô5Ø�F‰F”<Õ r)   c                 ó&   •— ‰j                  d«      S )Nzsupposed to failr—  )r[  r%   s    €r'   r8   z0SpreadUtilTests.test_asyncFail.<locals>.<lambda>´  s   ø€  4§9¡9Ð-?Ó#@€ r)   )r�  rá   r#  )r%   rf  r$  rw  s   `   r'   Útest_asyncFailzSpreadUtilTests.test_asyncFail©  s6   ø€ ô ÓˆØ�L‰L˜Ó ˆô	!ð 	
�‰Ó@À"ÔEØˆr)   c                 ój   — t        «       }|j                  d«      }| j                   |d«      d«       y)zM
        Test the C{remoteMethod} facility of L{util.LocalAsRemote}.
        rp  rÛ   rß   N)r�  r½  rX  )r%   rf  Úms      r'   Útest_remoteMethodz!SpreadUtilTests.test_remoteMethod·  s.   € ô ÓˆØ�N‰N˜6Ó"ˆØ×Ñ™˜1›˜qÕ!r)   c                 ó‚  — t        «       }t        j                  |t        «      }|j	                  d«       | j                  |j                  «       |j	                  d«       | j                  |j                  «       |j	                  d«      }g }|j                  |j                  «       | j                  |d   d«       y)ze
        Test a call to L{util.LocalAsyncForwarder} using L{Forwarded} local
        object.
        rb  rk  rd  r   rR   N)rf  r   ÚLocalAsyncForwarderr`  rá   rÎ  rh  rY  rj  r_  r  rX  )r%   r1  ÚlfÚrrrÐ  s        r'   Útest_localAsyncForwarderz(SpreadUtilTests.test_localAsyncForwarder¿  s�   € ô
 ‹KˆÜ×%Ñ% a¬Ó4ˆØ
�‰�kÔ"Ø�‰˜Ÿ™Ô$Ø
�‰�oÔ&Ø×Ñ˜Ÿ™Ô'Ø�]‰]Ð,Ó-ˆØˆØ
�‰�q—x‘xÔ Ø×Ñ˜˜1™˜qÕ!r)   N)	r*   r+   r,   r3   rq  rs  ry  r|  r�  r-   r)   r'   rn  rn  �  s    „ ñò5ò
òò"ó"r)   rn  c                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)ÚPBWithSecurityOptionsTestsz&
    Test security customization.
    c                 ó¢   — t        j                  «       }|j                  d«      }| j                  |j                  t
        j                  «       y)zl
        By default, client broker should use C{jelly.globalSecurity} as
        security settings.
        N)r   r”   rk   r¼  Úsecurityr   ÚglobalSecurity©r%   r„  rc   s      r'   Ú!test_clientDefaultSecurityOptionsz<PBWithSecurityOptionsTests.test_clientDefaultSecurityOptionsÕ  s:   € ô
 ×$Ñ$Ó&ˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o¤u×';Ñ';Õ<r)   c                 ó´   — t        j                  t        «       «      }|j                  d«      }| j	                  |j
                  t        j                  «       y)zl
        By default, server broker should use C{jelly.globalSecurity} as
        security settings.
        N)r   r’   r=  rk   r¼  r…  r   r†  r‡  s      r'   Ú!test_serverDefaultSecurityOptionsz<PBWithSecurityOptionsTests.test_serverDefaultSecurityOptionsÞ  s>   € ô
 ×$Ñ$¤V£XÓ.ˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o¤u×';Ñ';Õ<r)   c                 ó²   — t        j                  «       }t        j                  |¬«      }|j	                  d«      }| j                  |j                  |«       y)zs
        Check that the security settings are passed from the client factory to
        the broker object.
        ©r…  N)r   ÚSecurityOptionsr   r”   rk   r¼  r…  ©r%   r…  r„  rc   s       r'   Ú test_clientSecurityCustomizationz;PBWithSecurityOptionsTests.test_clientSecurityCustomizationç  sD   € ô
 ×(Ñ(Ó*ˆÜ×$Ñ$¨hÔ7ˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o xÕ0r)   c                 óÄ   — t        j                  «       }t        j                  t	        «       |¬«      }|j                  d«      }| j                  |j                  |«       y)zs
        Check that the security settings are passed from the server factory to
        the broker object.
        rŒ  N)r   r�  r   r’   r=  rk   r¼  r…  rŽ  s       r'   Ú test_serverSecurityCustomizationz;PBWithSecurityOptionsTests.test_serverSecurityCustomizationñ  sH   € ô
 ×(Ñ(Ó*ˆÜ×$Ñ$¤V£X¸ÔAˆØ×&Ñ& tÓ,ˆØ�‰�f—o‘o xÕ0r)   N)r*   r+   r,   r3   rˆ  rŠ  r�  r‘  r-   r)   r'   rƒ  rƒ  Ð  s   „ ñò=ò=ò1ó1r)   rƒ  r0   )�r3   ré  r“  rç  rK   rµ  Úcollectionsr   Úior   rl   Ú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#   ÚIRealmr5   rA   rw   ry   r…   r—   r¹  r™   r¤   ÚCopyabler¨   Ú
RemoteCopyrµ   ÚsetUnjellyableForClassr¹   rÅ   ÚsetUnjellyableFactoryForClassrÇ   Ú	CacheablerÎ   rÒ   rÔ   ÚRemoteCacherì   rô   r  r
  r  r'  r.  r2  r:  ÚRootr=  rF  ÚSynchronousTestCaserL  r’   rs  ÚTestCaser{  r�  r  r  r  r  r  r#  r,  ÚPublishablerN  ÚRemotePublishedrR  r  r\  r¡   rw  rk  rj  ÚLocalAsRemoter�  r:   r‹  rž  r’  rª  r²  rÄ  rJ  rT  r`  rf  rn  rƒ  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)   