§
    Ètºf5  ã                   óØ  — d Z ddlZddlZddlZddlmZ ddlmZmZm	Z	m
Z
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  G d
„ dej        ¦  «        Z e e
j        ed¦  «         d¦  «         G d„ dej        ¦  «        ¦   «         Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z  e e
j!        ed¦  «         d¦  «         G d„ dej        ¦  «        ¦   «         Z"dS )zK
Tests for implementations of L{IReactorUNIX} and L{IReactorUNIXDatagram}.
é    N)ÚskipIf)ÚaddressÚdeferÚerrorÚ
interfacesÚprotocolÚreactorÚutils)Úlockfile)ÚnetworkString)ÚFilePath)ÚMyClientFactoryÚMyServerFactory)Úunittestc                   ó   — e Zd Zd„ Zd„ ZdS )ÚFailedConnectionClientFactoryc                 ó   — || _         d S ©N)ÚonFail)Úselfr   s     úU/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/test/test_unix.pyÚ__init__z&FailedConnectionClientFactory.__init__   s   € ØˆŒˆˆó    c                 ó:   — | j                              |¦  «         d S r   )r   Úerrback)r   Ú	connectorÚreasons      r   ÚclientConnectionFailedz4FailedConnectionClientFactory.clientConnectionFailed   s   € ØŒ×Ò˜FÑ#Ô#Ð#Ð#Ð#r   N)Ú__name__Ú
__module__Ú__qualname__r   r   © r   r   r   r      s2   € € € € € ðð ð ð$ð $ð $ð $ð $r   r   ú1This reactor does not support UNIX domain socketsc                   ón   — e Zd ZdZ ej        ed¦  «        sdZd„ Zd„ Z	d„ Z
d„ Zd„ Zd	„ Zd
„ Zd„ Zd„ ZdS )ÚUnixSocketTestsz
    Test unix sockets.
    Nr#   c                 ó  ‡ ‡‡— ‰                       ¦   «         }‰                       ¦   «         Št          ¦   «         Št          j        ¦   «         x}‰_        t          j        |‰¦  «        }‰                      |j        ¦  «         t          j	        t          j
        t          j        ¦  «        }‰                      |j        ¦  «         |                     ‰¦  «         |                     |¦  «         ˆˆ ˆfd„}|                     |¦  «         |S )zè
        The address passed to the server factory's C{buildProtocol} method and
        the address returned by the connected protocol's transport's C{getPeer}
        method match the address the client socket is bound to.
        c                 óÂ   •— t          j        ‰¦  «        }‰                     ‰j        |g¦  «         ‰                     | j                             ¦   «         |¦  «         d S r   )r   ÚUNIXAddressÚassertEqualÚpeerAddressesÚ	transportÚgetPeer)ÚprotoÚexpectedÚpeernamer   ÚserverFactorys     €€€r   Ú
cbConnMadez1UnixSocketTests.test_peerBind.<locals>.cbConnMade;   sX   ø€ ÝÔ*¨8Ñ4Ô4ˆHØ×Ò˜]Ô8¸8¸*ÑEÔEÐEØ×Ò˜Uœ_×4Ò4Ñ6Ô6¸ÑAÔAÐAÐAÐAr   )Úmktempr   r   ÚDeferredÚprotocolConnectionMader	   Ú
listenUNIXÚ
addCleanupÚstopListeningÚsocketÚAF_UNIXÚSOCK_STREAMÚcloseÚbindÚconnectÚaddCallback)r   ÚfilenameÚconnMadeÚunixPortÚ
unixSocketr1   r/   r0   s   `     @@r   Útest_peerBindzUnixSocketTests.test_peerBind*   sþ   øøø€ ð —;’;‘=”=ˆØ—;’;‘=”=ˆÝ'Ñ)Ô)ˆÝ:?¼.Ñ:JÔ:JÐJˆ�=Ô7ÝÔ% h°Ñ>Ô>ˆØ�Š˜Ô.Ñ/Ô/Ð/Ý”]¥6¤>µ6Ô3EÑFÔFˆ
Ø�Š˜
Ô(Ñ)Ô)Ð)Ø�Š˜Ñ!Ô!Ð!Ø×Ò˜8Ñ$Ô$Ð$ð	Bð 	Bð 	Bð 	Bð 	Bð 	Bð 	Bð
 	×Ò˜ZÑ(Ô(Ð(Øˆr   c                 óÀ  ‡ ‡‡— ‰                       ¦   «         Št          ¦   «         }t          j        ¦   «         }||_        t          j        ‰|¦  «        }‰                      |j        ¦  «         t          ¦   «         Št          j        ¦   «         }|‰_        t          j
        ‰‰¦  «         t          j        ||g¦  «        }ˆˆˆ fd„}|                     |¦  «         |S )zŠ
        L{IReactorUNIX.connectUNIX} can be used to connect a client to a server
        started with L{IReactorUNIX.listenUNIX}.
        c                 óÒ   •— | \  }}‰                      ‰j        t          j        ‰¦  «        g¦  «         |j                             ¦   «          |j                             ¦   «          d S r   )r)   r*   r   r(   r+   ÚloseConnection)ÚargsÚserverProtocolÚclientProtocolÚclientFactoryr?   r   s      €€€r   ÚallConnectedz1UnixSocketTests.test_dumber.<locals>.allConnectedT   so   ø€ Ø-1Ñ*ˆN˜Nð ×ÒØÔ+­gÔ.AÀ(Ñ.KÔ.KÐ-Lñô ð ð Ô$×3Ò3Ñ5Ô5Ð5ØÔ$×3Ò3Ñ5Ô5Ð5Ð5Ð5r   )r2   r   r   r3   r4   r	   r5   r6   r7   r   ÚconnectUNIXÚgatherResultsr>   )	r   r0   ÚserverConnMaderA   ÚclientConnMadeÚdrK   rJ   r?   s	   `      @@r   Útest_dumberzUnixSocketTests.test_dumberC   sß   øøø€ ð
 —;’;‘=”=ˆÝ'Ñ)Ô)ˆÝœÑ)Ô)ˆØ/=ˆÔ,ÝÔ% h°Ñ>Ô>ˆØ�Š˜Ô.Ñ/Ô/Ð/Ý'Ñ)Ô)ˆÝœÑ)Ô)ˆØ/=ˆÔ,ÝÔ˜H mÑ4Ô4Ð4ÝÔ °Ð @ÑAÔAˆð		6ð 		6ð 		6ð 		6ð 		6ð 		6ð 		6ð 	
�Š�lÑ#Ô#Ð#Øˆr   c                 ó"  ‡ ‡‡‡	— ‰                       ¦   «         Št          ¦   «         }t          j        ¦   «         }||_        t          j        ‰|d¬¦  «        Š	‰                      t          j	        ‰dz   ¦  «        ¦  «         t          ¦   «         Št          j        ¦   «         }|‰_        t          j        ‰‰d¬¦  «         t          j        ||g¦  «        }ˆˆˆ ˆ	fd„}|                     |¦  «         ˆˆ fd„}|                     |¦  «         |S )zà
        A lockfile is created and locked when L{IReactorUNIX.listenUNIX} is
        called and released when the Deferred returned by the L{IListeningPort}
        provider's C{stopListening} method is called back.
        T©ÚwantPIDú.locké   ©ÚcheckPIDc                 óö   •— | \  }}‰                      ‰j        t          j        ‰¦  «        g¦  «         |j                             ¦   «          |j                             ¦   «          ‰                     ¦   «         S r   )r)   r*   r   r(   r+   rF   r7   )rG   rH   ÚclientProtorJ   r?   r   rA   s      €€€€r   Ú
_portStuffz0UnixSocketTests.test_pidFile.<locals>._portStuffy   s{   ø€ Ø*.Ñ'ˆN˜Kð ×ÒØÔ+­gÔ.AÀ(Ñ.KÔ.KÐ-Lñô ð ð Ô!×0Ò0Ñ2Ô2Ð2ØÔ$×3Ò3Ñ5Ô5Ð5Ø×)Ò)Ñ+Ô+Ð+r   c                 ó^   •— ‰                      t          j        ‰dz   ¦  «        d¦  «         d S )NrU   Úlocked)ÚassertFalser   ÚisLocked)Úignoredr?   r   s    €€r   Ú_checkz,UnixSocketTests.test_pidFile.<locals>._checkˆ   s/   ø€ Ø×Ò�XÔ.¨x¸'Ñ/AÑBÔBÀHÑMÔMÐMÐMÐMr   )r2   r   r   r3   r4   r	   r5   Ú
assertTruer   r_   r   rL   rM   r>   )
r   r0   rN   rO   rP   r[   ra   rJ   r?   rA   s
   `      @@@r   Útest_pidFilezUnixSocketTests.test_pidFileb   s6  øøøø€ ð —;’;‘=”=ˆÝ'Ñ)Ô)ˆÝœÑ)Ô)ˆØ/=ˆÔ,ÝÔ% h°ÀtÐLÑLÔLˆØ�Š�Ô)¨(°WÑ*<Ñ=Ô=Ñ>Ô>Ð>õ
 (Ñ)Ô)ˆÝœÑ)Ô)ˆØ/=ˆÔ,ÝÔ˜H m¸aÐ@Ñ@Ô@Ð@åÔ °Ð @ÑAÔAˆð	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	
�Š�jÑ!Ô!Ð!ð	Nð 	Nð 	Nð 	Nð 	Nð 	Nð 	
�Š�fÑÔÐØˆr   c                 ó.  ‡‡— |                       ¦   «         Št          ¦   «         Št          j        ‰‰d¬¦  «        }|                      t
          j        t          j        ‰‰d¬¦  «         ˆˆfd„}|                     ¦   «                              |¦  «        S )z›
        L{IReactorUNIX.listenUNIX} raises L{error.CannotListenError} if passed
        the name of a file on which a server is already listening.
        TrS   c                 óZ   •— t          j        ‰‰d¬¦  «        }|                     ¦   «         S ©NTrS   )r	   r5   r7   )ÚignrA   r?   r0   s     €€r   ÚstoppedListeningz<UnixSocketTests.test_socketLocking.<locals>.stoppedListeningŸ   s,   ø€ ÝÔ)¨(°MÈ4ÐPÑPÔPˆHØ×)Ò)Ñ+Ô+Ð+r   )	r2   r   r	   r5   ÚassertRaisesr   ÚCannotListenErrorr7   r>   )r   rA   rh   r?   r0   s      @@r   Útest_socketLockingz"UnixSocketTests.test_socketLockingŽ   s¨   øø€ ð
 —;’;‘=”=ˆÝ'Ñ)Ô)ˆÝÔ% h°ÀtÐLÑLÔLˆà×ÒÝÔ#ÝÔØØØð 	ñ 	
ô 	
ð 	
ð	,ð 	,ð 	,ð 	,ð 	,ð 	,ð ×%Ò%Ñ'Ô'×3Ò3Ð4DÑEÔEÐEr   c                 óÄ  — |                       ¦   «         | _        t          d| j        ›d�¦  «        }dt          t          j                             t          j        ¦  «        ¦  «         	                    ¦   «         j        i}t          t          j
        ¦  «         	                    ¦   «         j        }t          j        |dd|f|¬¦  «        }|                     |¦  «         |S )NzBfrom twisted.internet import protocol, reactor
reactor.listenUNIX(z), protocol.ServerFactory(),wantPID=True)
s
   PYTHONPATHs   -us   -c)Úenv)r2   r?   r   r   ÚosÚpathsepÚjoinÚsysÚpathÚasBytesModeÚ
executabler
   ÚgetProcessValuer>   )r   ÚcallbackÚsourcerm   ÚpyExerP   s         r   Ú_uncleanSocketTestz"UnixSocketTests._uncleanSocketTest¥   s¸   € ØŸš™œˆŒÝ�ð Œ}ˆ}ˆ}ðñ
ô 
ˆð �h¥r¤z§¢µs´xÑ'@Ô'@ÑAÔA×MÒMÑOÔOÔTÐUˆÝ�œÑ(Ô(×4Ò4Ñ6Ô6Ô;ˆåÔ! %¨%°¸Ð)?ÀSÐIÑIÔIˆØ	�Š�hÑÔÐØˆr   c                 ó8   ‡ — ˆ fd„}‰                       |¦  «        S )a"  
        If passed C{True} for the C{wantPID} parameter, a server can be started
        listening with L{IReactorUNIX.listenUNIX} when passed the name of a
        file on which a previous server which has not exited cleanly has been
        listening using the C{wantPID} option.
        c                 ó|   •— t          j        ‰j        t          ¦   «         d¬¦  «        }|                     ¦   «         S rf   )r	   r5   r?   r   r7   )rg   Úpr   s     €r   ÚranStupidChildzGUnixSocketTests.test_uncleanServerSocketLocking.<locals>.ranStupidChild¾   s2   ø€ åÔ" 4¤=µ/Ñ2CÔ2CÈTÐRÑRÔRˆAØ—?’?Ñ$Ô$Ð$r   ©ry   ©r   r}   s   ` r   Útest_uncleanServerSocketLockingz/UnixSocketTests.test_uncleanServerSocketLocking¶   s2   ø€ ð	%ð 	%ð 	%ð 	%ð 	%ð
 ×&Ò& ~Ñ6Ô6Ð6r   c                 ó8   ‡ — ˆ fd„}‰                       |¦  «        S )z¶
        If passed C{True} for the C{checkPID} parameter, a client connection
        attempt made with L{IReactorUNIX.connectUNIX} fails with
        L{error.BadFileError}.
        c                 óÀ   •— t          j        ¦   «         }t          |¦  «        }t          j        ‰j        |d¬¦  «         ‰                     |t          j        ¦  «        S )NTrW   )	r   r3   r   r	   rL   r?   ÚassertFailurer   ÚBadFileError)rg   rP   Úfr   s      €r   r}   zCUnixSocketTests.test_connectToUncleanServer.<locals>.ranStupidChildÌ   sP   ø€ Ý”Ñ Ô ˆAÝ-¨aÑ0Ô0ˆAÝÔ ¤¨q¸4Ð@Ñ@Ô@Ð@Ø×%Ò% a­Ô);Ñ<Ô<Ð<r   r~   r   s   ` r   Útest_connectToUncleanServerz+UnixSocketTests.test_connectToUncleanServerÅ   s2   ø€ ð	=ð 	=ð 	=ð 	=ð 	=ð ×&Ò& ~Ñ6Ô6Ð6r   c                 óf  ‡ ‡‡— ‰                       ¦   «         }t          j        ||¦  «        Šd‰› d|›d�}‰                      t	          ‰¦  «        |¦  «         ‰                      t          ‰¦  «        |¦  «         t          j        ‰j        ¦  «        }ˆˆ ˆfd„}| 	                    |¦  «         |S )z~
        Test the C{__str__} and C{__repr__} implementations of a UNIX port when
        used with the given factory.
        ú<ú on ú>c                 ó    •— d‰› d�}‰                      t          ‰¦  «        |¦  «         ‰                      t          ‰¦  «        |¦  «         d S ©Nrˆ   z (not listening)>©r)   ÚreprÚstr)rg   ÚunconnectedStringÚfactoryNamer   rA   s     €€€r   rh   z3UnixSocketTests._reprTest.<locals>.stoppedListeningâ   sT   ø€ Ø B KÐ BÐ BÐ BÐØ×Ò�T (™^œ^Ð->Ñ?Ô?Ð?Ø×Ò�S ™]œ]Ð,=Ñ>Ô>Ð>Ð>Ð>r   )
r2   r	   r5   r)   rŽ   r�   r   ÚmaybeDeferredr7   r>   )r   r0   r‘   r?   ÚconnectedStringrP   rh   rA   s   ` `    @r   Ú	_reprTestzUnixSocketTests._reprTestÔ   sÆ   øøø€ ð
 —;’;‘=”=ˆÝÔ% h°Ñ>Ô>ˆà<˜kÐ<Ð<¨xÐ<Ð<Ð<ˆØ×Ò�˜h™œ¨Ñ9Ô9Ð9Ø×Ò�˜X™œ¨Ñ8Ô8Ð8åÔ Ô 6Ñ7Ô7ˆð	?ð 	?ð 	?ð 	?ð 	?ð 	?ð 	?ð
 	
�ŠÐ&Ñ'Ô'Ð'Øˆr   c                 óŽ   —  G d„ d¦  «        }|                       |t          ¦  «         |                       |¦   «         d¦  «        S )a!  
        The two string representations of the L{IListeningPort} returned by
        L{IReactorUNIX.listenUNIX} contains the name of the new-style factory
        class being used and the filename on which the port is listening or
        indicates that the port is not listening.
        c                   ó   — e Zd Zd„ Zd„ ZdS )úEUnixSocketTests.test_reprWithNewStyleFactory.<locals>.NewStyleFactoryc                 ó   — d S r   r"   ©r   s    r   ÚdoStartzMUnixSocketTests.test_reprWithNewStyleFactory.<locals>.NewStyleFactory.doStartó   ó   € Ø�r   c                 ó   — d S r   r"   r™   s    r   ÚdoStopzLUnixSocketTests.test_reprWithNewStyleFactory.<locals>.NewStyleFactory.doStopö   r›   r   N)r   r    r!   rš   r�   r"   r   r   ÚNewStyleFactoryr—   ò   ó2   € € € € € ðð ð ðð ð ð ð r   rž   z&twisted.test.test_unix.NewStyleFactory©ÚassertIsInstanceÚtyper”   )r   rž   s     r   Útest_reprWithNewStyleFactoryz,UnixSocketTests.test_reprWithNewStyleFactoryê   sf   € ð	ð 	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	×Ò˜o­tÑ4Ô4Ð4à�~Š~ØˆOÑÔÐGñ
ô 
ð 	
r   )r   r    r!   Ú__doc__r   ÚIReactorUNIXr	   ÚskiprC   rQ   rc   rk   ry   r€   r†   r”   r£   r"   r   r   r%   r%      sÈ   € € € € € ð
ð ð #ˆ:Ô" 7¨DÑ1Ô1ð CØBˆðð ð ð2ð ð ð>*ð *ð *ðXFð Fð Fð.ð ð ð"7ð 7ð 7ð7ð 7ð 7ðð ð ð,
ð 
ð 
ð 
ð 
r   r%   c                   ó2   — e Zd ZdxZZdZd„ Zd„ Zd„ Zd„ Z	dS )ÚClientProtoFNc                 óf   — t          j        ¦   «         | _        t          j        ¦   «         | _        d S r   )r   r3   ÚdeferredStartedÚdeferredGotBackr™   s    r   r   zClientProto.__init__  ó(   € Ý$œ~Ñ/Ô/ˆÔÝ$œ~Ñ/Ô/ˆÔÐÐr   c                 ó   — d| _         d S ©NT©Ústoppedr™   s    r   ÚstopProtocolzClientProto.stopProtocol	  ó   € ØˆŒˆˆr   c                 óH   — d| _         | j                             d ¦  «         d S r®   ©Ústartedrª   rv   r™   s    r   ÚstartProtocolzClientProto.startProtocol  ó&   € ØˆŒØÔ×%Ò% dÑ+Ô+Ð+Ð+Ð+r   c                 óH   — || _         | j                             d ¦  «         d S r   )Úgotbackr«   rv   )r   Údatas     r   ÚdatagramReceivedzClientProto.datagramReceived  r·   r   )
r   r    r!   rµ   r°   r¹   r   r±   r¶   r»   r"   r   r   r¨   r¨     s_   € € € € € ØÐ€GˆgØ€Gð0ð 0ð 0ðð ð ð,ð ,ð ,ð,ð ,ð ,ð ,ð ,r   r¨   c                   ó6   — e Zd ZdxZZdxZZd„ Zd„ Zd„ Z	d„ Z
dS )ÚServerProtoFNc                 óf   — t          j        ¦   «         | _        t          j        ¦   «         | _        d S r   )r   r3   rª   ÚdeferredGotWhatr™   s    r   r   zServerProto.__init__  r¬   r   c                 ó   — d| _         d S r®   r¯   r™   s    r   r±   zServerProto.stopProtocol  r²   r   c                 óH   — d| _         | j                             d ¦  «         d S r®   r´   r™   s    r   r¶   zServerProto.startProtocol   r·   r   c                 óŒ   — || _         | j                             d|¦  «         || _        | j                             d ¦  «         d S )Nó   hi back)Úgotfromr+   ÚwriteÚgotwhatr¿   rv   )r   rº   Úaddrs      r   r»   zServerProto.datagramReceived$  sE   € ØˆŒØŒ×Ò˜Z¨Ñ.Ô.Ð.ØˆŒØÔ×%Ò% dÑ+Ô+Ð+Ð+Ð+r   )r   r    r!   rµ   r°   rÆ   rÄ   r   r±   r¶   r»   r"   r   r   r½   r½     sd   € € € € € ØÐ€GˆgØÐ€Gˆgð0ð 0ð 0ðð ð ð,ð ,ð ,ð,ð ,ð ,ð ,ð ,r   r½   z3This reactor does not support UNIX datagram socketsc                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )ÚDatagramUnixSocketTestsz%
    Test datagram UNIX sockets.
    c                 ó  ‡ ‡‡‡	— ‰                       ¦   «         Š‰                       ¦   «         }t          ¦   «         Š	t          ¦   «         Št          j        |‰	¦  «        }‰                      |j        ¦  «         t          j        |‰‰¬¦  «        }‰                      |j        ¦  «         t          j	        ‰	j
        ‰j
        g¦  «        }ˆˆ	fd„}ˆˆˆ ˆ	fd„}|                     |¦  «         |                     |¦  «         |S )zf
        Test that a datagram can be sent to and received by a server and vice
        versa.
        )ÚbindAddressc                 óx   •— ‰j                              d¦  «         t          j        ‰j        ‰j        g¦  «        S )Nó   hi)r+   rÅ   r   rM   r¿   r«   )r`   ÚcpÚsps    €€r   rÅ   z4DatagramUnixSocketTests.test_exchange.<locals>.writeD  s5   ø€ ØŒL×Ò˜uÑ%Ô%Ð%ÝÔ&¨Ô(:¸BÔ<NÐ'OÑPÔPÐPr   c                 óª   •— ‰                      d‰j        ¦  «         ‰                      ‰‰j        ¦  «         ‰                      d‰j        ¦  «         d S )NrÍ   rÃ   )r)   rÆ   rÄ   r¹   )r`   Ú
clientaddrrÎ   r   rÏ   s    €€€€r   Ú_cbTestExchangez>DatagramUnixSocketTests.test_exchange.<locals>._cbTestExchangeH  sQ   ø€ Ø×Ò˜U B¤JÑ/Ô/Ð/Ø×Ò˜Z¨¬Ñ4Ô4Ð4Ø×Ò˜Z¨¬Ñ4Ô4Ð4Ð4Ð4r   )r2   r½   r¨   r	   ÚlistenUNIXDatagramr6   r7   ÚconnectUNIXDatagramr   rM   rª   r>   )
r   Ú
serveraddrÚsÚcrP   rÅ   rÒ   rÑ   rÎ   rÏ   s
   `      @@@r   Útest_exchangez%DatagramUnixSocketTests.test_exchange4  s  øøøø€ ð
 —[’[‘]”]ˆ
Ø—[’[‘]”]ˆ
Ý‰]Œ]ˆÝ‰]Œ]ˆÝÔ& z°2Ñ6Ô6ˆØ�Š˜œÑ(Ô(Ð(ÝÔ'¨
°BÀJÐOÑOÔOˆØ�Š˜œÑ(Ô(Ð(åÔ Ô!3°RÔ5GÐ HÑIÔIˆð	Qð 	Qð 	Qð 	Qð 	Qð 	Qð	5ð 	5ð 	5ð 	5ð 	5ð 	5ð 	5ð 	5ð
 	
�Š�eÑÔÐØ	�Š�oÑ&Ô&Ð&Øˆr   c                 ó  — |                       ¦   «         }t          ¦   «         }t          j        ||¦  «        }|                      t
          j        t          j        ||¦  «         |                     ¦   «          t          j	        |¦  «         dS )zž
        L{IReactorUNIXDatagram.listenUNIXDatagram} raises
        L{error.CannotListenError} if the unix socket specified is already in
        use.
        N)
r2   r½   r	   rÓ   ri   r   rj   r7   rn   Úunlink)r   rÇ   r|   rÖ   s       r   Útest_cannotListenz)DatagramUnixSocketTests.test_cannotListenQ  sn   € ð �{Š{‰}Œ}ˆÝ‰MŒMˆÝÔ& t¨QÑ/Ô/ˆØ×Ò�%Ô1µ7Ô3MÈtÐUVÑWÔWÐWØ	�ŠÑÔÐÝ
Œ	�$‰Œˆˆˆr   c                 óf  ‡ ‡‡— ‰                       ¦   «         }t          j        ||¦  «        Šd‰› d|›d�}‰                      t	          ‰¦  «        |¦  «         ‰                      t          ‰¦  «        |¦  «         t          j        ‰j        ¦  «        }ˆˆ ˆfd„}| 	                    |¦  «         |S )zˆ
        Test the C{__str__} and C{__repr__} implementations of a UNIX datagram
        port when used with the given protocol.
        rˆ   r‰   rŠ   c                 ó    •— d‰› d�}‰                      t          ‰¦  «        |¦  «         ‰                      t          ‰¦  «        |¦  «         d S rŒ   r�   )rg   r�   ÚprotocolNamer   rA   s     €€€r   rh   z;DatagramUnixSocketTests._reprTest.<locals>.stoppedListeningn  sT   ø€ Ø C LÐ CÐ CÐ CÐØ×Ò�T (™^œ^Ð->Ñ?Ô?Ð?Ø×Ò�S ™]œ]Ð,=Ñ>Ô>Ð>Ð>Ð>r   )
r2   r	   rÓ   r)   rŽ   r�   r   r’   r7   r>   )r   ÚserverProtorÞ   r?   r“   ÚstopDeferredrh   rA   s   ` `    @r   r”   z!DatagramUnixSocketTests._reprTest`  sÉ   øøø€ ð
 —;’;‘=”=ˆÝÔ-¨h¸ÑDÔDˆà=˜lÐ=Ð=°Ð=Ð=Ð=ˆØ×Ò�˜h™œ¨Ñ9Ô9Ð9Ø×Ò�˜X™œ¨Ñ8Ô8Ð8åÔ*¨8Ô+AÑBÔBˆð	?ð 	?ð 	?ð 	?ð 	?ð 	?ð 	?ð
 	× Ò Ð!1Ñ2Ô2Ð2ØÐr   c                 óŽ   —  G d„ d¦  «        }|                       |t          ¦  «         |                       |¦   «         d¦  «        S )a2  
        The two string representations of the L{IListeningPort} returned by
        L{IReactorUNIXDatagram.listenUNIXDatagram} contains the name of the
        new-style protocol class being used and the filename on which the port
        is listening or indicates that the port is not listening.
        c                   ó   — e Zd Zd„ Zd„ ZdS )úODatagramUnixSocketTests.test_reprWithNewStyleProtocol.<locals>.NewStyleProtocolc                 ó   — d S r   r"   )r   r+   s     r   ÚmakeConnectionz^DatagramUnixSocketTests.test_reprWithNewStyleProtocol.<locals>.NewStyleProtocol.makeConnection  r›   r   c                 ó   — d S r   r"   r™   s    r   r�   zVDatagramUnixSocketTests.test_reprWithNewStyleProtocol.<locals>.NewStyleProtocol.doStop‚  r›   r   N)r   r    r!   rå   r�   r"   r   r   ÚNewStyleProtocolrã   ~  rŸ   r   rç   z'twisted.test.test_unix.NewStyleProtocolr    )r   rç   s     r   Útest_reprWithNewStyleProtocolz5DatagramUnixSocketTests.test_reprWithNewStyleProtocolv  sh   € ð	ð 	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	×ÒÐ.µÑ5Ô5Ð5à�~Š~ØÐÑÔÐ Iñ
ô 
ð 	
r   N)r   r    r!   r¤   rØ   rÛ   r”   rè   r"   r   r   rÉ   rÉ   +  sZ   € € € € € ð
ð ðð ð ð:ð ð ðð ð ð,
ð 
ð 
ð 
ð 
r   rÉ   )#r¤   rn   r8   rq   r   r   Útwisted.internetr   r   r   r   r   r	   r
   Útwisted.pythonr   Útwisted.python.compatr   Útwisted.python.filepathr   Útwisted.test.test_tcpr   r   Útwisted.trialÚClientFactoryr   r¥   ÚTestCaser%   ÚConnectedDatagramProtocolr¨   ÚDatagramProtocolr½   ÚIReactorUNIXDatagramrÉ   r"   r   r   ú<module>rô      s8  ððð ð
 
€	€	€	Ø €€€Ø 
€
€
€
Ø Ð Ð Ð Ð Ð à XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XÐ XØ #Ð #Ð #Ð #Ð #Ð #Ø /Ð /Ð /Ð /Ð /Ð /Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BØ "Ð "Ð "Ð "Ð "Ð "ð$ð $ð $ð $ð $ HÔ$:ñ $ô $ð $ð €Øˆ
Ô ¨Ñ.Ô.Ð.Ø7ñô ð\
ð \
ð \
ð \
ð \
�hÔ'ñ \
ô \
ñ	ô ð\
ð~,ð ,ð ,ð ,ð ,�(Ô4ñ ,ô ,ð ,ð(,ð ,ð ,ð ,ð ,�(Ô+ñ ,ô ,ð ,ð, €Ø'ˆ
Ô'¨°Ñ6Ô6Ð6Ø9ñô ð[
ð [
ð [
ð [
ð [
˜hÔ/ñ [
ô [
ñ	ô ð[
ð [
ð [
r   