U
    
W[>c                     @   s  d Z ddlZddlZddlmZ ddlmZ ddlmZm	Z	m
Z
 ddlmZmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZ ddlmZ e reejZejejed< n"e Zejej e! ed< G dd dej"Z#ddlm$Z$ ddlm%Z% ddl&m'Z' G dd dej(Z)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2ddlm3Z3 z@ddl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: dd l;m<Z<m=Z=m>Z>m?Z?m@Z@ W n eAk
r   d!ZBY nX d"ZBG d#d$ d$e7jCZDG d%d& d&e8jEZFG d'd( d(e5jGZHG d)d* d*e6jIZJG d+d, d,e?ZKG d-d. d.e=ZLG d/d0 d0e<ZMe	NeLeMe9jO G d1d2 d2e%jPZQG d3d4 d4ZRG d5d6 d6eRZSdd7lTmUZU G d8d9 d9ejVeUjWZXG d:d; d;ejYeUjWZZG d<d= d=eRZ[zdd>lm\Z\ W n eAk
r   dZ\Y nX G d?d@ d@eRZ]G dAdB dBZ^G dCdD dDe[ej"e^Z_G dEdF dFeSej"e^Z`G dGdH dHe]ej"e^ZaG dIdJ dJZbG dKdL dLe[ej"ebZcG dMdN dNeSej"ebZdG dOdP dPe]ej"ebZeG dQdR dRej"ZfdS )SzU
Tests for L{twisted.conch.recvline} and fixtures for testing related
functionality.
    N)insults)recvline)reflect
componentsfilepath)	iterbytesbytesEnviron)platform)defererror)unittest)portal)StringTransport
PYTHONPATHs
   PYTHONPATHc                   @   sl   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd ZdS )ArrowsTestsc                    sF   t   _t  _t  _ fdd j_  j_	 j
 j d S )Nc                      s    j S N)p selfr   B/usr/lib/python3/dist-packages/twisted/conch/test/test_recvline.py<lambda>'       z#ArrowsTests.setUp.<locals>.<lambda>)r   ZunderlyingTransportr   ServerProtocolptr   HistoricRecvLiner   protocolFactoryfactorymakeConnectionr   r   r   r   setUp#   s    

zArrowsTests.setUpc                 C   s@   | j dd | j dd | j dd | | j  d dS )zy
        When L{HistoricRecvLine} receives a printable character,
        it adds it to the current line buffer.
           xN   y   z   xyzr   )r   keystrokeReceivedassertEqualcurrentLineBufferr   r   r   r   test_printableCharacters,   s    z$ArrowsTests.test_printableCharactersc                    sF   fdd}t dD ]}|| q  j d | jj   j d | jj   j d | jj   j d | jj   j d | jj   j d | jj   j d | jj   j d | jj   j d | jj   j d dS )	z
        When L{HistoricRecvLine} receives a LEFT_ARROW or
        RIGHT_ARROW keystroke it moves the cursor left or right
        in the current line buffer, respectively.
        c                    s    j | d S r   r   r%   chr   r   r   r   >   r   z3ArrowsTests.test_horizontalArrows.<locals>.<lambda>r$   r#   )   xyr"   )r    s   yz)r   r$   N)r   r&   r   r'   r   ZRIGHT_ARROW
LEFT_ARROWr   kRr+   r   r   r   test_horizontalArrows8   s,    
z!ArrowsTests.test_horizontalArrowsc                    s|    fdd}t dD ]}|| q  j d |d |d |d   j d |d   j d	 d
S )z
        When {HistoricRecvLine} receives a newline, it adds the current
        line buffer to the end of its history buffer.
        c                    s    j | d S r   r)   r*   r   r   r   r   e   r   z*ArrowsTests.test_newline.<locals>.<lambda>   xyz
abc
123
r$      abc   123r      c   b   a   
))r$   r4   r5   s   cbar   N)r   r&   r   currentHistoryBufferr.   r   r   r   test_newline`   s     
zArrowsTests.test_newlinec                    s8   fdd}t dD ]}|| q  j d   j d | jj   j d   j d | jj   j d   j d	 | jj   j d
   j d | jj   j d
   j d tdD ]}| jj q  j d dS )a  
        When L{HistoricRecvLine} receives UP_ARROW or DOWN_ARROW
        keystrokes it move the current index in the current history
        buffer up or down, and resets the current line buffer to the
        previous or next line in history, respectively for each.
        c                    s    j | d S r   r)   r*   r   r   r   r      r   z1ArrowsTests.test_verticalArrows.<locals>.<lambda>r1   r2   r   r   ))r$   r4   )r5   )r5   r   ))r$   )r4   r5   )r4   r   )r   r3   r#      N)	r   r&   r   r:   r'   r   ZUP_ARROWrangeZ
DOWN_ARROW)r   r/   r+   ir   r   r   test_verticalArrowsx   s@    
zArrowsTests.test_verticalArrowsc                    sV    fdd}t dD ]}|| q  j d | jj   j d dS )z
        When L{HistoricRecvLine} receives a HOME keystroke it moves the
        cursor to the beginning of the current line buffer.
        c                    s    j | d S r   r)   r*   r   r   r   r      r   z'ArrowsTests.test_home.<locals>.<lambda>   hello, worldrA   r   )r   rA   N)r   r&   r   r'   r   HOMEr.   r   r   r   	test_home   s    
zArrowsTests.test_homec                    sb    fdd}t dD ]}|| q  j d | jj | jj   j d dS )z
        When L{HistoricRecvLine} receives an END keystroke it moves the cursor
        to the end of the current line buffer.
        c                    s    j | d S r   r)   r*   r   r   r   r      r   z&ArrowsTests.test_end.<locals>.<lambda>rA   rB   N)r   r&   r   r'   r   rC   ZENDr.   r   r   r   test_end   s    
zArrowsTests.test_endc                    s    fdd}t dD ]}|| q  j d | jj   j d | jj | jj   j d | jj   j d dS )z
        When L{HistoricRecvLine} receives a BACKSPACE keystroke it deletes
        the character immediately before the cursor.
        c                    s    j | d S r   r)   r*   r   r   r   r      r   z,ArrowsTests.test_backspace.<locals>.<lambda>r$   r#   r,   r   )r   r!   N)r   r&   r   r'   r   Z	BACKSPACEr-   r.   r   r   r   test_backspace   s    
zArrowsTests.test_backspacec                    s    fdd}t dD ]}|| q  j d | jj   j d | jj | jj   j d | jj | jj   j d | jj | jj   j d | jj   j d dS )	z
        When L{HistoricRecvLine} receives a DELETE keystroke, it
        delets the character immediately after the cursor.
        c                    s    j | d S r   r)   r*   r   r   r   r      r   z)ArrowsTests.test_delete.<locals>.<lambda>r$   r#   rF   )r    r   r<   N)r   r&   r   r'   r   ZDELETEr-   r.   r   r   r   test_delete   s"    
zArrowsTests.test_deletec                    sr    fdd}t dD ]}|| q| jj |d   j d | jj |d   j d dS )	z
        When not in INSERT mode, L{HistoricRecvLine} inserts the typed
        character at the cursor before the next character.
        c                    s    j | d S r   r)   r*   r   r   r   r      r   z)ArrowsTests.test_insert.<locals>.<lambda>r$      A)   xyAr"      B)   xyBs   AzN)r   r   r-   r&   r   r'   r.   r   r   r   test_insert   s    
zArrowsTests.test_insertc                    s~    fdd}t dD ]}|| q| jj | jj |d   j d | jj |d   j d dS )	a  
        When in INSERT mode and upon receiving a keystroke with a printable
        character, L{HistoricRecvLine} replaces the character at
        the cursor with the typed character rather than inserting before.
        Ah, the ironies of INSERT mode.
        c                    s    j | d S r   r)   r*   r   r   r   r     r   z+ArrowsTests.test_typeover.<locals>.<lambda>r$   rI   )rJ   r   rK   )rL   r   N)r   r   ZINSERTr-   r&   r   r'   r.   r   r   r   test_typeover  s    
zArrowsTests.test_typeoverc                    sr    fdd} j }|j|j|j|j|j|j|j|j|j	|j
|j|j|j|jfD ]}||   j d qNdS )z
        When L{HistoricRecvLine} receives a keystroke for an unprintable
        function key with no assigned behavior, the line buffer is unmodified.
        c                    s    j | d S r   r)   r*   r   r   r   r   $  r   z8ArrowsTests.test_unprintableCharacters.<locals>.<lambda>r<   N)r   ZF1ZF2ZF3ZF4ZF5ZF6ZF7ZF8ZF9ZF10ZF11ZF12ZPGUPZPGDNr&   r   r'   )r   r/   r   r+   r   r   r   test_unprintableCharacters  s          z&ArrowsTests.test_unprintableCharactersN)__name__
__module____qualname__r   r(   r0   r;   r@   rD   rE   rG   rH   rM   rN   rO   r   r   r   r   r   "   s   	(*r   )telnet)helper)LoopbackRelayc                   @   s   e Zd Zdd ZdS )
EchoServerc                 C   s    | j |d | j| j   d S )Nr9   )ZterminalwriteZpsZpn)r   liner   r   r   lineReceived3  s    zEchoServer.lineReceivedN)rP   rQ   rR   rY   r   r   r   r   rV   2  s   rV   s   [Ds   [Cs   [As   [Bs   [2~s   [1~s   [3~s   [4~   )checkers)userauth	transportchannel
connectionsessionkeys)TerminalUserTerminalSessionTerminalRealmTerminalSessionTransportConchFactoryFTc                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )SessionChannels   sessionc                 O   s6   t jj| f|| || _|| _|| _|| _|| _d S r   )r^   
SSHChannel__init__r   protocolArgsprotocolKwArgswidthheightr   r   rj   rk   rl   rm   akwr   r   r   ri   N  s    zSessionChannel.__init__c                 C   sd   t d| j| jddfd}| j| d| | j| dd | j| j| j| _	| | j	_
| j	|  d S )Ns   vt102r   r   s   pty-reqs   shell)r`   ZpackRequest_pty_reqrm   rl   connZsendRequestr   rj   rk   _protocolInstancer   r   )r   dataZtermr   r   r   channelOpenY  s    zSessionChannel.channelOpenc                 C   s   | j t  d S r   )rr   connectionLostr   ZConnectionDoner   r   r   r   closedc  s    zSessionChannel.closedc                 C   s   | j | d S r   )rr   dataReceivedr   rs   r   r   r   rw   g  s    zSessionChannel.dataReceivedN)rP   rQ   rR   nameri   rt   rv   rw   r   r   r   r   rg   K  s
   
rg   c                   @   s$   e Zd Zdd Zdd Zdd ZdS )TestConnectionc                 O   s6   t jj| f|| || _|| _|| _|| _|| _d S r   )r_   SSHConnectionri   r   rj   rk   rl   rm   rn   r   r   r   ri   l  s    zTestConnection.__init__c                 C   s,   t | j| j| j| j| j| _| | j d S r   )rg   r   rj   rk   rl   rm   _TestConnection__channelZopenChannelr   r   r   r   serviceStartedw  s    zTestConnection.serviceStartedc                 C   s   | j |S r   )r|   rW   rx   r   r   r   rW   |  s    zTestConnection.writeN)rP   rQ   rR   ri   r}   rW   r   r   r   r   rz   k  s   rz   c                   @   s   e Zd Zdd Zdd ZdS )TestAuthc                 O   s    t jj| |f|| || _d S r   )r\   SSHUserAuthClientri   password)r   usernamer   ro   rp   r   r   r   ri     s    zTestAuth.__init__c                 C   s   t | jS r   )r
   succeedr   r   r   r   r   getPassword  s    zTestAuth.getPasswordN)rP   rQ   rR   ri   r   r   r   r   r   r~     s   r~   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestTransportc           
      O   s.   || _ || _|| _|| _|| _|| _|| _d S r   )r   rj   rk   r   r   rl   rm   )
r   r   rj   rk   r   r   rl   rm   ro   rp   r   r   r   ri     s    zTestTransport.__init__c                 C   s
   t dS )NT)r
   r   )r   ZhostKeyZfingerprintr   r   r   verifyHostKey  s    zTestTransport.verifyHostKeyc                 C   s8   t | j| j| j| j| j| _| t| j	| j
| j d S r   )rz   r   rj   rk   rl   rm   _TestTransport__connectionZrequestServicer~   r   r   r   r   r   r   connectionSecure  s    zTestTransport.connectionSecurec                 C   s   | j |S r   )r   rW   rx   r   r   r   rW     s    zTestTransport.writeN)rP   rQ   rR   ri   r   r   rW   r   r   r   r   r     s   
r   c                   @   s   e Zd Zdd ZdS )TestSessionTransportc                 C   s   | j jjj S r   )Zavatarrq   r]   r   serverProtocolr   r   r   r   r     s    z$TestSessionTransport.protocolFactoryN)rP   rQ   rR   r   r   r   r   r   r     s   r   c                   @   s   e Zd ZeZdS )TestSessionN)rP   rQ   rR   r   ZtransportFactoryr   r   r   r   r     s   r   c                   @   s   e Zd ZdS )TestUserNrP   rQ   rR   r   r   r   r   r     s   r   c                   @   s$   e Zd Zdd Zdd Zdd ZdS )NotifyingExpectableBufferc                 C   s   t  | _t  | _d S r   )r
   ZDeferredonConnectiononDisconnectionr   r   r   r   ri     s    
z"NotifyingExpectableBuffer.__init__c                 C   s   t j|  | j|  d S r   )rT   ExpectableBufferconnectionMader   callbackr   r   r   r   r     s    z(NotifyingExpectableBuffer.connectionMadec                 C   s   | j | d S r   )r   Zerrback)r   reasonr   r   r   ru     s    z(NotifyingExpectableBuffer.connectionLostN)rP   rQ   rR   ri   r   ru   r   r   r   r   r     s   r   c                   @   s$   e Zd ZdZdZdd Zdd ZdS )
_BaseMixinP      c                 C   s   | j   }|dg| jt| d   }| t|t| tt|D ]Z}| || || d|td|d |d  d d|td|d |d    qJd S )Nr      r   s    != )	recvlineClient	__bytes__
splitlinesHEIGHTlenr&   r>   joinmax)r   linesZreceivedLinesZexpectedLinesr?   r   r   r   _assertBuffer  s     z_BaseMixin._assertBufferc                    s.   j d}|  fdd}||S )Ns   donec                    s      d S r   )r   )Zignoutputr   r   r   finished  s    z)_BaseMixin._trivialTest.<locals>.finished)r   expect
_testwriteZaddCallback)r   Z	inputLiner   Zdoner   r   r   r   _trivialTest  s    
z_BaseMixin._trivialTestN)rP   rQ   rR   WIDTHr   r   r   r   r   r   r   r     s   r   c                   @   s   e Zd Zdd Zdd ZdS )	_SSHMixinc                    s@  t stdd\}}t }t|_fdd|_t }|	|| t
|}|| t|}tjt|  dd}||jd< ||jd< | j|_|  |  tfdd|d }t|}	t tfd	d t fd
ddi ||| j| j}
t|
}|
 |	 | | | _!|
| _"|| _#|	| _$|| _%j&S )NzMcryptography requirements missing, can't run historic recvline tests over ssh)s   testusers   testpassc                      s    S r   r   r   insultsServerr   r   r     r   z!_SSHMixin.setUp.<locals>.<lambda>i   )ZkeySizes   ssh-rsac                      s    S r   r   r   recvlineServerr   r   r     r   c                      s    S r   r   r   r   r   r   r     r   c                      s    S r   r   r   insultsClientr   r   r      r   r   )'sshr   ZSkipTestrd   r   ZuserFactoryZchainedProtocolFactoryr[   Z'InMemoryUsernamePasswordDatabaseDontUseZaddUserr   ZPortalZregisterCheckerrf   ra   Z_getPersistentRSAKeyr   ZFilePathZmktempZ
publicKeysZprivateKeysr   ZstartFactoryr   r   ZbuildProtocolrU   r   ClientProtocolr   r   r   r   r   	sshClient	sshServerclientTransportserverTransportr   )r   ur   ZrlmZcheckerZptlZ
sshFactoryZsshKeyr   r   r   r   r   r   r   r   r   r   r     sH    




 

z_SSHMixin.setUpc                 C   s   | j | d S r   )r   rW   rx   r   r   r   r     s    z_SSHMixin._testwriteNrP   rQ   rR   r   r   r   r   r   r   r     s   /r   )test_telnetc                   @   s   e Zd ZdS )TestInsultsClientProtocolNr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdS )TestInsultsServerProtocolNr   r   r   r   r   r     s   r   c                   @   s   e Zd Zdd Zdd ZdS )_TelnetMixinc                    s   |   tfddtfdd}t|}t tfdd t fdd}t|}|| || |  |  | _	|| _
|| _|| _jS )Nc                      s    S r   r   r   r   r   r   r   %  r   z$_TelnetMixin.setUp.<locals>.<lambda>c                      s    S r   r   r   r   r   r   r   &  r   c                      s    S r   r   r   r   r   r   r   *  r   c                      s    S r   r   r   r   r   r   r   +  r   )r   r   rS   ZTelnetTransportrU   r   r   r   ZclearBufferr   telnetClientr   r   r   )r   ZtelnetServerr   r   r   r   r   r   r   #  s"    

z_TelnetMixin.setUpc                 C   s   | j | d S r   )r   rW   rx   r   r   r   r   <  s    z_TelnetMixin._testwriteNr   r   r   r   r   r   "  s   r   )stdioc                   @   s$   e Zd Zdd Zdd Zdd ZdS )_StdioMixinc                    s   t   t fdd}t|}tj}tj}|dsB|drN|d d }||t	
| jg}t svdd |D }dd	lm} |j|||td
d}  | _| _|| _|| _ttd |j dgS )Nc                      s    S r   r   r   testTerminalr   r   r   Q  r   z#_StdioMixin.setUp.<locals>.<lambda>z.pycz.pyoc                 S   s   g | ]}| t qS r   )encodesysgetfilesystemencoding).0argr   r   r   
<listcomp>a  s     z%_StdioMixin.setUp.<locals>.<listcomp>r   )reactorT)envZusePTYs   >>> )r   r   r   r   ZTerminalProcessProtocolr   
executable__file__endswithr   Zqualr   r	   	isWindowstwisted.internetr   ZspawnProcess	properEnvr   r   processClientr   r
   ZgatherResultsfilterr   r   )r   r   r   exemoduleargsr   r   r   r   r   r   G  s,    

 z_StdioMixin.setUpc              	      sF   z j d W n tjtfk
r*   Y nX  fdd} jj|S )NZKILLc                    s.   |  tj  | jj  | jjd d S )N	   )trapr   ZProcessTerminatedZassertIsNonevalueZexitCoder&   Zstatus)Zfailurer   r   r   r   y  s    z"_StdioMixin.tearDown.<locals>.trap)r   ZsignalProcessr   ZProcessExitedAlreadyOSErrorr   r   Z
addErrback)r   r   r   r   r   tearDowns  s    z_StdioMixin.tearDownc                 C   s   | j | d S r   )r   rW   rx   r   r   r   r     s    z_StdioMixin._testwriteN)rP   rQ   rR   r   r   r   r   r   r   r   r   F  s   ,r   c                   @   sX   e Zd ZeZdd Zdd Zdd Zdd Zd	d
 Z	dd Z
dd Zdd Zdd ZdS )RecvlineLoopbackMixinc                 C   s   |  ddddgS )Ns   first line
done   >>> first line
   first line   >>> done)r   r   r   r   r   
testSimple  s    z RecvlineLoopbackMixin.testSimplec                 C   s"   |  td td  d dddgS )Nr   r=   	   xxxx
dones   >>> first xxxxs
   first xxxxr   )r   insertleftr   r   r   r   testLeftArrow  s    z#RecvlineLoopbackMixin.testLeftArrowc                 C   s*   |  td td  td  d dddgS )Ns
   right liner=      s   xx
dones   >>> right lixxs
   right lixxr   )r   r   r   rightr   r   r   r   testRightArrow  s    z$RecvlineLoopbackMixin.testRightArrowc                 C   s   |  dtd  d dddgS )N   second liner=   r   s   >>> second xxxxs   second xxxxr   )r   	backspacer   r   r   r   testBackspace  s    z#RecvlineLoopbackMixin.testBackspacec                 C   s&   |  dtd  td  d dddgS )Ns   delete xxxxr=   	   line
dones   >>> delete lines   delete liner   )r   r   deleter   r   r   r   
testDelete  s    z RecvlineLoopbackMixin.testDeletec                 C   s   |  dtd  d dddgS )Ns	   third ine      l
dones   >>> third lines
   third liner   )r   r   r   r   r   r   
testInsert  s    z RecvlineLoopbackMixin.testInsertc                 C   s"   |  dtd  t d dddgS )Ns   fourth xiner=   r   s   >>> fourth lines   fourth liner   )r   r   r   r   r   r   r   testTypeover  s    z"RecvlineLoopbackMixin.testTypeoverc                 C   s   |  td t d dddgS )Ns	   blah lines	   home
dones   >>> home lines	   home liner   )r   r   homer   r   r   r   testHome  s    zRecvlineLoopbackMixin.testHomec                 C   s"   |  dtd  t d dddgS )Ns   end r=   r   s   >>> end lines   end liner   )r   r   endr   r   r   r   testEnd  s    zRecvlineLoopbackMixin.testEndN)rP   rQ   rR   rV   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s   e Zd ZdS )RecvlineLoopbackTelnetTestsNr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdS )RecvlineLoopbackSSHTestsNr   r   r   r   r   r     s   r   c                   @   s   e Zd ZedkrdZdS )RecvlineLoopbackStdioTestsNzBTerminal requirements missing, can't run recvline tests over stdiorP   rQ   rR   r   skipr   r   r   r   r     s   r   c                   @   s(   e Zd ZeZdd Zdd Zdd ZdS )HistoricRecvlineLoopbackMixinc                 C   s   |  dt d dddddgS )Ns   first line
   
doner   r   r   )r   upr   r   r   r   testUpArrow  s    
z)HistoricRecvlineLoopbackMixin.testUpArrowc                 C   s"   |  dt t d dddddgS )aH  
        Pressing down arrow to visit an entry that was added to the
        history by pressing the up arrow instead of return does not
        raise a L{TypeError}.

        @see: U{http://twistedmatrix.com/trac/ticket/9031}

        @return: A L{defer.Deferred} that fires when C{b"done"} is
            echoed back.
        s   first line
partial liner   r   r   s   >>> partial lines   partial liner   r   r   downr   r   r   r   $test_DownArrowToPartialLineInHistory  s    zBHistoricRecvlineLoopbackMixin.test_DownArrowToPartialLineInHistoryc              
   C   s*   |  dtd  t d dddddddgS )	Ns   first line
second line
r   r   r   r   s   >>> second liner   r   r   r   r   r   r   testDownArrow  s    z+HistoricRecvlineLoopbackMixin.testDownArrowN)rP   rQ   rR   rV   r   r   r   r  r   r   r   r   r     s   
r   c                   @   s   e Zd ZdS )#HistoricRecvlineLoopbackTelnetTestsNr   r   r   r   r   r    s   r  c                   @   s   e Zd ZdS ) HistoricRecvlineLoopbackSSHTestsNr   r   r   r   r   r    s   r  c                   @   s   e Zd ZedkrdZdS )"HistoricRecvlineLoopbackStdioTestsNzKTerminal requirements missing, can't run historic recvline tests over stdior   r   r   r   r   r    s   r  c                   @   s   e Zd ZdZdd ZdS )TransportSequenceTestsz5
    L{twisted.conch.recvline.TransportSequence}
    c                 C   s   |  ttj dS )zh
        Initializing a L{recvline.TransportSequence} with no args
        raises an assertion.
        N)ZassertRaisesAssertionErrorr   ZTransportSequencer   r   r   r   test_invalidSequence%  s    z+TransportSequenceTests.test_invalidSequenceN)rP   rQ   rR   __doc__r  r   r   r   r   r     s   r  )gr  osr   Ztwisted.conch.insultsr   Ztwisted.conchr   Ztwisted.pythonr   r   r   Ztwisted.python.compatr   r   Ztwisted.python.runtimer	   r   r
   r   Ztwisted.trialr   Ztwisted.credr   Ztwisted.test.proto_helpersr   r   dictenvironr   pathsepr   pathr   r   ZTestCaser   rS   rT   Ztwisted.conch.test.loopbackrU   r   rV   r   r   r   r   r   r   r   r   r   r[   Ztwisted.conch.sshr\   r]   r^   r_   r`   ra   Ztwisted.conch.manhole_sshrb   rc   rd   re   rf   ImportErrorr   rh   rg   r{   rz   r   r~   ZSSHClientTransportr   r   r   r   ZregisterAdapterZISessionr   r   r   r   Ztwisted.conch.testr   r   ZTestProtocolr   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r   r   r   r   <module>   s   
    
 
5
?L/