%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/test_recvline.cpython-312.pyc

�

Ϫ�fb��V�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZmZmZdd
lmZddlmZddlmZmZed
�Zeej:�Zej>jAejB�ed<Gd�de�Z"ddlm#Z#ddlm$Z$ddl%m&Z&Gd�dejN�Z(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1ddl	m2Z2	dd l3m4Z4m5Z5m6Z6m7Z7m8Z8dd!l9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?d"Z@Gd#�d$e:j��ZBGd%�d&e;j��ZDGd'�d(e?j��ZFGd)�d*e>j��ZHGd+�d,e7�ZIGd-�d.e6�ZJGd/�d0e8�ZKej�eJeKe=j��Gd2�d3e$j��ZPGd4�d5�ZQGd6�d7eQ�ZRdd8lSmTZTGd9�d:ej�eTj��ZWGd;�d<ej�eTj��ZYGd=�d>eQ�ZZGd?�d@eQ�Z[GdA�dB�Z\GdC�dDeZee\�Z]GdE�dFeRee\�Z^eedG�GdH�dIe[ee\��Z_GdJ�dK�Z`GdL�dMeZee`�ZaGdN�dOeRee`�ZbeedP�GdQ�dRe[ee`��ZcGdS�dTe�Zdy#eN$rd1Z@Y��wxYw)UzU
Tests for L{twisted.conch.recvline} and fixtures for testing related
functionality.
�N)�skipIf)�recvline)�insults)�portal)�defer�error)�StringTransport)�
components�filepath�reflect)�	iterbytes)�
requireModule)�SkipTest�TestCaseztwisted.conch.stdio�
PYTHONPATHc�T�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�ArrowsTestsc���t��_tj��_tj��_�fd��j_��j_	�jj�j�y)Nc����jS�N)�p��selfs��B/usr/lib/python3/dist-packages/twisted/conch/test/test_recvline.py�<lambda>z#ArrowsTests.setUp.<locals>.<lambda>"s���$�&�&��)r	�underlyingTransportr�ServerProtocol�ptr�HistoricRecvLiner�protocolFactory�factory�makeConnectionrs`r�setUpzArrowsTests.setUps]���#2�#4�� ��(�(�*����*�*�,���"0���������������t�7�7�8rc��|jjdd�|jjdd�|jjdd�|j|jj�d�y)zy
        When L{HistoricRecvLine} receives a printable character,
        it adds it to the current line buffer.
        �xN�y�z��xyzr)r�keystrokeReceived�assertEqual�currentLineBufferrs r�test_printableCharactersz$ArrowsTests.test_printableCharacters&s]��
	
��� � ��t�,���� � ��t�,���� � ��t�,�������1�1�3�]�Crc����fd�}td�D]
}||���j�jj�d�|�jj
��j�jj�d�|�jj��j�jj�d�|�jj��j�jj�d�|�jj��j�jj�d�|�jj��j�jj�d�|�jj
��j�jj�d�|�jj
��j�jj�d�|�jj
��j�jj�d�|�jj
��j�jj�d�y)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�<���jj|d�Sr�rr+��chrs �rrz3ArrowsTests.test_horizontalArrows.<locals>.<lambda>7�������0�0��T�:�rr*r))�xyr()r&syz)rr*N)r
r,rr-r�RIGHT_ARROW�
LEFT_ARROW�r�kRr3s`  r�test_horizontalArrowsz!ArrowsTests.test_horizontalArrows1s����;���F�#�	�B��r�F�	�	
������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�C�
�4�7�7����������1�1�3�]�Crc�|���fd�}td�D]
}||���j�jj�d�|d�|d�|d��j�jj�d�|d��j�jj�d�y	)
z�
        When {HistoricRecvLine} receives a newline, it adds the current
        line buffer to the end of its history buffer.
        c�<���jj|d�Srr1r2s �rrz*ArrowsTests.test_newline.<locals>.<lambda>]r4r�xyz
abc
123
��r*�abc�123��c�b�a�
))r*r@rAscbarBN)r
r,r�currentHistoryBufferr8s`  r�test_newlinezArrowsTests.test_newlineXs����
;���.�/�	�B��r�F�	�	
������4�4�6�8V�W�
�4��
�4��
�4��������4�4�6�8V�W�
�5�	�����F�F�'�'�)�+Q�	
rc����fd�}td�D]
}||���j�jj�d��j�jj	�d�|�j
j��j�jj�d��j�jj	�d�|�j
j��j�jj�d��j�jj	�d�|�j
j��j�jj�d	��j�jj	�d
�|�j
j��j�jj�d	��j�jj	�d
�td�D]}|�j
j�� �j�jj�d�y)
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�<���jj|d�Srr1r2s �rrz1ArrowsTests.test_verticalArrows.<locals>.<lambda>ur4rr=r>�rr))r*r@)rA)rAr))r*)r@rA)r@r)rBr?r)�N)	r
r,rrGr-r�UP_ARROW�range�
DOWN_ARROW)rr9r3�is`   r�test_verticalArrowszArrowsTests.test_verticalArrowsns����;���.�/�	�B��r�F�	�	
������4�4�6�8V�W�������1�1�3�Z�@�
�4�7�7����������4�4�6�8U�V�������1�1�3�]�C�
�4�7�7����������4�4�6�8U�V�������1�1�3�]�C�
�4�7�7����������4�4�6�8V�W�������1�1�3�]�C�
�4�7�7����������4�4�6�8V�W�������1�1�3�]�C��q��	#�A��t�w�w�!�!�"�	#�������4�4�6�8V�Wrc� ���fd�}td�D]
}||���j�jj�d�|�jj
��j�jj�d�y)z�
        When L{HistoricRecvLine} receives a HOME keystroke it moves the
        cursor to the beginning of the current line buffer.
        c�<���jj|d�Srr1r2s �rrz'ArrowsTests.test_home.<locals>.<lambda>�r4r�hello, world�rTr)rrTN)r
r,rr-r�HOMEr8s`  r�	test_homezArrowsTests.test_home�sq���
;���O�,�	�B��r�F�	�������1�1�3�5K�L�
�4�7�7�<�<��������1�1�3�5K�Lrc�X���fd�}td�D]
}||���j�jj�d�|�jj
�|�jj��j�jj�d�y)z�
        When L{HistoricRecvLine} receives an END keystroke it moves the cursor
        to the end of the current line buffer.
        c�<���jj|d�Srr1r2s �rrz&ArrowsTests.test_end.<locals>.<lambda>�r4rrTrUN)r
r,rr-rrV�ENDr8s`  r�test_endzArrowsTests.test_end�s����
;���O�,�	�B��r�F�	�������1�1�3�5K�L�
�4�7�7�<�<��
�4�7�7�;�;��������1�1�3�5K�Lrc�p���fd�}td�D]
}||���j�jj�d�|�jj
��j�jj�d�|�jj�|�jj
��j�jj�d�|�jj
��j�jj�d�y)z�
        When L{HistoricRecvLine} receives a BACKSPACE keystroke it deletes
        the character immediately before the cursor.
        c�<���jj|d�Srr1r2s �rrz,ArrowsTests.test_backspace.<locals>.<lambda>�r4rr*r)�r5r)rr'N)r
r,rr-r�	BACKSPACEr7r8s`  r�test_backspacezArrowsTests.test_backspace�s����
;���F�#�	�B��r�F�	�������1�1�3�]�C�
�4�7�7����������1�1�3�\�B�
�4�7�7����
�4�7�7����������1�1�3�[�A�
�4�7�7����������1�1�3�[�Arc����fd�}td�D]
}||���j�jj�d�|�jj
��j�jj�d�|�jj�|�jj
��j�jj�d�|�jj�|�jj
��j�jj�d�|�jj�|�jj
��j�jj�d�|�jj
��j�jj�d�y)z�
        When L{HistoricRecvLine} receives a DELETE keystroke, it
        delets the character immediately after the cursor.
        c�<���jj|d�Srr1r2s �rrz)ArrowsTests.test_delete.<locals>.<lambda>�r4rr*r)r^)r&rrKN)r
r,rr-r�DELETEr7r8s`  r�test_deletezArrowsTests.test_delete�sY���
;���F�#�	�B��r�F�	�������1�1�3�]�C�
�4�7�7�>�>��������1�1�3�]�C�
�4�7�7����
�4�7�7�>�>��������1�1�3�\�B�
�4�7�7����
�4�7�7�>�>��������1�1�3�[�A�
�4�7�7����
�4�7�7�>�>��������1�1�3�Z�@�
�4�7�7�>�>��������1�1�3�Z�@rc�x���fd�}td�D]
}||��|�jj�|d��j�jj�d�|�jj�|d��j�jj�d�y)z�
        When not in INSERT mode, L{HistoricRecvLine} inserts the typed
        character at the cursor before the next character.
        c�<���jj|d�Srr1r2s �rrz)ArrowsTests.test_insert.<locals>.<lambda>�r4rr*�A)�xyAr(�B)�xyBsAzN)r
rr7r,rr-r8s`  r�test_insertzArrowsTests.test_insert�s����
;���F�#�	�B��r�F�	�	�4�7�7����
�4��������1�1�3�^�D�
�4�7�7����
�4��������1�1�3�_�Erc����fd�}td�D]
}||��|�jj�|�jj�|d��j	�j
j
�d�|�jj�|d��j	�j
j
�d�y)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�<���jj|d�Srr1r2s �rrz+ArrowsTests.test_typeover.<locals>.<lambda>�r4rr*rg)rhrri)rjrN)r
r�INSERTr7r,rr-r8s`  r�
test_typeoverzArrowsTests.test_typeover�s����;���F�#�	�B��r�F�	�	�4�7�7�>�>��
�4�7�7����
�4��������1�1�3�]�C�
�4�7�7����
�4��������1�1�3�]�Crc�����fd�}�j}|j|j|j|j|j
|j|j|j|j|j|j|j|j|jfD]4}||��j�j j#�d��6y)z�
        When L{HistoricRecvLine} receives a keystroke for an unprintable
        function key with no assigned behavior, the line buffer is unmodified.
        c�<���jj|d�Srr1r2s �rrz8ArrowsTests.test_unprintableCharacters.<locals>.<lambda>
r4rrKN)r�F1�F2�F3�F4�F5�F6�F7�F8�F9�F10�F11�F12�PGUP�PGDNr,rr-)rr9rr3s`   r�test_unprintableCharactersz&ArrowsTests.test_unprintableCharacterss����
;��
�W�W��
�E�E��E�E��E�E��E�E��E�E��E�E��E�E��E�E��E�E��F�F��F�F��F�F��G�G��G�G�
�	E�B� 
�r�F����T�V�V�5�5�7��D�#	ErN)�__name__�
__module__�__qualname__r$r.r:rHrQrWr[r`rdrkror�rBrrrrsJ��9�	D�%D�N
�,!X�FM�
M�B�*A�:F�$D�,Err)�telnet)�helper)�
LoopbackRelayc��eZdZd�Zy)�
EchoServerc�t�|jj|dz|j|jz�y)NrF)�terminal�write�ps�pn)r�lines  r�lineReceivedzEchoServer.lineReceived*s*���
�
���D�5�L�4�7�7�4�7�7�+;�;�<rN)r�r�r�r�rBrrr�r�)s��=rr�sssss[2~s[1~s[3~s[4~�)�checkers)�ConchFactory�
TerminalRealm�TerminalSession�TerminalSessionTransport�TerminalUser)�channel�
connection�keys�session�	transport�userauthTc�(�eZdZdZd�Zd�Zd�Zd�Zy)�SessionChannelssessionc��tjj|g|��i|��||_||_||_||_||_yr)r��
SSHChannel�__init__r!�protocolArgs�protocolKwArgs�width�height�rr!r�r�r�r��a�kws        rr�zSessionChannel.__init__SsH��
���'�'��7�q�7�B�7�#2�D� � ,�D��"0�D���D�J� �D�Krc��tjd|j|jddfd�}|jj|d|�|jj|dd�|j|ji|j��|_	||j_
|jj|�y)Nsvt102rrspty-reqsshell)r��packRequest_pty_reqr�r��conn�sendRequestr!r�r��_protocolInstancer"r#)r�data�terms   r�channelOpenzSessionChannel.channelOpen_s����.�.��4�;�;��
�
�A�q�9�3��D�
�I�I�!�!�$�
�D�9��I�I�!�!�$��#�6�%9�T�%9�%9��"�"�&�&*�&9�&9�&�D�"�.2�D�"�"�*��"�"�1�1�$�7rc�^�|jjtj��yr)r��connectionLostr�ConnectionDoners r�closedzSessionChannel.closedls���"�"�1�1�%�2F�2F�2H�Irc�:�|jj|�yr)r��dataReceived�rr�s  rr�zSessionChannel.dataReceivedos���"�"�/�/��5rN)r�r�r��namer�r�r�r�rBrrr�r�Ps����
	!�	8�	J�	6rr�c��eZdZd�Zd�Zd�Zy)�TestConnectionc��tjj|g|��i|��||_||_||_||_||_yr)r��
SSHConnectionr�r!r�r�r�r�r�s        rr�zTestConnection.__init__ssH��
�$�$�-�-�d�=�Q�=�"�=�#2�D� � ,�D��"0�D���D�J� �D�Krc���t|j|j|j|j|j
�|_|j|j�yr)r�r!r�r�r�r��_TestConnection__channel�openChannelrs r�serviceStartedzTestConnection.serviceStartedsK��+��$�$��!�!��#�#��
�
�����D�N�
���T�^�^�,rc�8�|jj|�Sr)r�r�r�s  rr�zTestConnection.write�s���>�>�'�'��-�-rN)r�r�r�r�r�r�rBrrr�r�rs��
	!�	-�	.rr�c��eZdZd�Zd�Zy)�TestAuthc�Z�tjj||g|��i|��||_yr)r��SSHUserAuthClientr��password)r�usernamer�r�r�s     rr�zTestAuth.__init__�s)���&�&�/�/��h�I��I�b�I�$�D�Mrc�@�tj|j�Sr)r�succeedr�rs r�getPasswordzTestAuth.getPassword�s���=�=����/�/rN)r�r�r�r�r�rBrrr�r��s��	%�	0rr�c�$�eZdZd�Zd�Zd�Zd�Zy)�
TestTransportc�f�||_||_||_||_||_||_||_yr)r!r�r�r�r�r�r�)
rr!r�r�r�r�r�r�r�r�s
          rr�zTestTransport.__init__�s8��$3�D� � ,�D��"0�D��$�D�M�$�D�M��D�J� �D�Krc�,�tjd�S)NT)rr�)r�hostKey�fingerprints   r�
verifyHostKeyzTestTransport.verifyHostKey�s���=�=��&�&rc��t|j|j|j|j|j
�|_|jt|j|j|j��yr)r�r!r�r�r�r��_TestTransport__connection�requestServicer�r�r�rs r�connectionSecurezTestTransport.connectionSecure�sb�� .��$�$��!�!��#�#��
�
����!�D��
��������
�
�t�7H�7H�I�
rc�8�|jj|�Sr)r�r�r�s  rr�zTestTransport.write�s���$�$�*�*�4�0�0rN)r�r�r�r�r�r�r�rBrrr�r��s��	!�(	'�
	�	1rr�c��eZdZd�Zy)�TestSessionTransportc�r�|jjjjj	�Sr)�avatarr�r�r"�serverProtocolrs rr!z$TestSessionTransport.protocolFactory�s'���;�;�#�#�-�-�5�5�D�D�F�FrN)r�r�r�r!rBrrr�r��s��	Grr�c��eZdZeZy)�TestSessionN)r�r�r�r��transportFactoryrBrrr�r��s��/�rr�c��eZdZy)�TestUserN�r�r�r�rBrrr�r��s��rr�Fc��eZdZd�Zd�Zd�Zy)�NotifyingExpectableBufferc�h�tj�|_tj�|_yr)r�Deferred�onConnection�onDisconnectionrs rr�z"NotifyingExpectableBuffer.__init__�s ��!�N�N�,���$�~�~�/��rc�x�tjj|�|jj	|�yr)r��ExpectableBuffer�connectionMader��callbackrs rr�z(NotifyingExpectableBuffer.connectionMade�s*�����.�.�t�4����"�"�4�(rc�:�|jj|�yr)r��errback)r�reasons  rr�z(NotifyingExpectableBuffer.connectionLost�s�����$�$�V�,rN)r�r�r�r�r�r�rBrrr�r��s��0�)�-rr�c� �eZdZdZdZd�Zd�Zy)�
_BaseMixin�P�c��|jj�j�}|dg|jt	|�z
dz
zz}|j||�y)Nr�)�recvlineClient�	__bytes__�
splitlines�HEIGHT�lenr,)r�lines�
receivedLines�
expectedLiness    r�
_assertBufferz_BaseMixin._assertBuffer�sR���+�+�5�5�7�B�B�D�
��#��$�+�+��E�
�*B�Q�*F�!G�H�
�����
�6rc�����jjd�}�j|���fd�}|j|�S)Nsdonec�(���j��yr)r�)�ign�outputrs ��r�finishedz)_BaseMixin._trivialTest.<locals>.finished�s������v�&r)r��expect�
_testwrite�addCallback)r�	inputLiner�doners` `  r�_trivialTestz_BaseMixin._trivialTest�s=����"�"�)�)�'�2�����	�"�	'�����)�)rN)r�r�r��WIDTHr�r�rrBrrr�r��s���E�
�F�7�
*rr�c��eZdZd�Zd�Zy)�	_SSHMixinc	����
���tstd��d\}}t�}t|_�
fd�|_t
j�}|j||�tj|�}|j|�t|�}tjtj |j#��d��}||j$d<||j&d<|j(|_|j+�|j)��t-j.�fd���
|j1d�}t3|�}	t5��t-j6�fd���t9�fd	�d
i|||j:|j<�}
t3|
�}|
j?|	�|j?|��|_ |
|_!||_"|	|_#||_$�jJS)NzMcryptography requirements missing, can't run historic recvline tests over ssh)stestuserstestpassc����SrrB��
insultsServers�rrz!_SSHMixin.setUp.<locals>.<lambda>�s���]�ri)�keySizesssh-rsac����SrrB��recvlineServers�rrz!_SSHMixin.setUp.<locals>.<lambda>����~�rc����SrrB�r�s�rrz!_SSHMixin.setUp.<locals>.<lambda>rrc����SrrB��
insultsClients�rrz!_SSHMixin.setUp.<locals>.<lambda>
s���M�rrB)&�sshrr�r��userFactory�chainedProtocolFactoryr��'InMemoryUsernamePasswordDatabaseDontUse�addUserr�Portal�registerCheckerr�r��_getPersistentRSAKeyr�FilePath�mktemp�
publicKeys�privateKeysr��startFactoryrr�
buildProtocolr�r��ClientProtocolr�r	r�r#r��	sshClient�	sshServer�clientTransport�serverTransportr�)r�ur�rlm�checker�ptl�
sshFactory�sshKeyr*r+r)r,rrr�rs            @@@@rr$z_SSHMixin.setUp�s������*��
�
(���1��o��"���%:��"��B�B�D������1���m�m�C� �����G�$�!�#�&�
��*�*����d�k�k�m�,�d�
��-3�
���j�)�-3�
���z�*�$(�$7�$7�
�!����!��,�,�.���.�.�/E�F�
��,�,�T�2�	�'�	�2��2�4���.�.�/E�F�
�!�!�2�r�1�a����T�[�[�
�	�(�	�2��� � ��1�� � ��1�,���"���"���.���.����*�*�*rc�:�|jj|�yr)r)r�r�s  rrz_SSHMixin._testwrites�������T�"rN�r�r�r�r$rrBrrrr�s
��0+�d#rr)�test_telnetc��eZdZy)�TestInsultsClientProtocolNr�rBrrr7r7#���rr7c��eZdZy)�TestInsultsServerProtocolNr�rBrrr:r:'r8rr:c��eZdZd�Zd�Zy)�_TelnetMixinc�������|j��t�fd���tj�fd��}t	|�}t��t
�fd���tj�fd��}t	|�}|j|�|j|�|j�|j��|_	||_
||_||_�jS)Nc����SrrBrs�rrz$_TelnetMixin.setUp.<locals>.<lambda>.����.�rc����SrrBrs�rrz$_TelnetMixin.setUp.<locals>.<lambda>/����m�rc����SrrBrs�rrz$_TelnetMixin.setUp.<locals>.<lambda>3r?rc����SrrBrs�rrz$_TelnetMixin.setUp.<locals>.<lambda>4rAr)r�r:r��TelnetTransportr�r�r7r#�clearBufferr��telnetClientr+r,r�)	r�telnetServerr+rFr,rrr�rs	     @@@@rr$z_TelnetMixin.setUp,s�����,�,�.��1�2H�I�
��-�-�.C�D��'��5��2�4��1�2H�I�
��-�-�.C�D��'��5���#�#�O�4��#�#�O�4��#�#�%��#�#�%�,���(���.���.����*�*�*rc�:�|jj|�yr)rFr�r�s  rrz_TelnetMixin._testwriteDs��������%rNr4rBrrr<r<+s��+�0&rr<c��eZdZd�Zd�Zd�Zy)�_StdioMixinc	�0��t��tj�fd��}tj	|�}t
j}tj}|jd�s|jd�r|dd}||tj|j�g}ddlm
}|j|||td��}�x|_|_||_||_t)j*t-d|j.�j1d	�g��S)
Nc����SrrB)�testTerminals�rrz#_StdioMixin.setUp.<locals>.<lambda>Ss���|�rz.pycz.pyo���r)�reactorT)�env�usePTYs>>> )r�rr(�stdio�TerminalProcessProtocol�sys�
executable�__file__�endswithr�qualr��twisted.internetrO�spawnProcess�	properEnvr�rM�
processClientr+r�
gatherResults�filterr�r)	rrr\�exe�module�argsrOr+rMs	        @rr$z_StdioMixin.setUpIs����
1�2��
 �.�.�/C�D�
�
�5�5�m�D�
�
�n�n�������?�?�6�"�f�o�o�f�&=��C�R�[�F��V�W�\�\�$�*=�*=�>�?��,�!�.�.��3��)�D�/�
��3?�>���d�/�*���.���
�"�"��4�-�4�4�l�6I�6I�'�6R�S�T�
�	
rc����	�jjd��fd�}�j
jj|�S#tjtf$rY�EwxYw)N�KILLc����|jtj��j|jj
��j
|jjd�y)N�	)�trapr�ProcessTerminated�assertIsNone�value�exitCoder,�status)�failurers �rrfz"_StdioMixin.tearDown.<locals>.trap{sG����L�L��0�0�1����g�m�m�4�4�5����W�]�]�1�1�1�5r)r+�
signalProcessr�ProcessExitedAlready�OSErrorrMr��
addErrback)rrfs` r�tearDownz_StdioMixin.tearDownts_���	�� � �.�.�v�6�	6�
� � �0�0�;�;�D�A�A���*�*�G�4�	��	�s�A�A$�#A$c�:�|jj|�yr)r+r�r�s  rrz_StdioMixin._testwrite�s�����"�"�4�(rN)r�r�r�r$rqrrBrrrJrJHs��)
�VB�)rrJc�F�eZdZeZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
y
)�RecvlineLoopbackMixinc�*�|jdgd��S)Nsfirst line
done)�>>> first line�
first line�>>> done)rrs r�
testSimplez RecvlineLoopbackMixin.testSimple�s��� � ��!P�
�	
rc�R�|jtdztdzzdzgd��S)NrwrL�	xxxx
done)s>>> first xxxxs
first xxxxrx)r�insert�leftrs r�
testLeftArrowz#RecvlineLoopbackMixin.testLeftArrow�s.��� � ��]�"�T�A�X�-�
�=�;�
�	
rc�f�|jtdztdzztdzzdzgd��S)Ns
right linerL�sxx
done)s>>> right lixxs
right lixxrx)rr|r}�rightrs r�testRightArrowz$RecvlineLoopbackMixin.testRightArrow�s7��� � ��]�"�T�A�X�-���	�9�K�G�;�
�	
rc�D�|jdtdzzdzgd��S)N�second linerLr{)s>>> second xxxxssecond xxxxrx)r�	backspacers r�
testBackspacez#RecvlineLoopbackMixin.testBackspace�s)��� � ��Y��]�*�]�:�=�
�	
rc�X�|jdtdzztdzzdzgd��S)Nsdelete xxxxrL�	line
done)s>>> delete linesdelete linerx)rr}�deleters r�
testDeletez RecvlineLoopbackMixin.testDelete�s2��� � ��T�A�X�%���
�2�]�B�=�
�	
rc�D�|jdtdzzdzgd��S)Ns	third ine��l
done)s>>> third lines
third linerx)rr}rs r�
testInsertz RecvlineLoopbackMixin.testInsert�s)��� � ��4�!�8�#�j�0�;�
�	
rc�R�|jdtdzztzdzgd��S)Nsfourth xinerLr�)s>>> fourth linesfourth linerx)rr}r|rs r�testTypeoverz"RecvlineLoopbackMixin.testTypeover�s.��� � ��T�A�X�%��.��;�=�
�	
rc�L�|jtdztzdzgd��S)Ns	blah lines	home
done)s
>>> home lines	home linerx)rr|�homers r�testHomezRecvlineLoopbackMixin.testHome�s*��� � ��\�!�D�(�=�8�9�
�	
rc�R�|jdtdzztzdzgd��S)Nsend rLr�)s>>> end linesend linerx)rr}�endrs r�testEndzRecvlineLoopbackMixin.testEnd�s.��� � ��d�Q�h���$�}�4�7�
�	
rN)r�r�r�r�r�ryr~r�r�r�r�r�r�r�rBrrrtrt�s4���N�
�

�
�
�
�
�
�
�
rrtc��eZdZy)�RecvlineLoopbackTelnetTestsNr�rBrrr�r��r8rr�c��eZdZy)�RecvlineLoopbackSSHTestsNr�rBrrr�r��r8rr�zBTerminal requirements missing, can't run recvline tests over stdioc��eZdZy)�RecvlineLoopbackStdioTestsNr�rBrrr�r��s��rr�c�"�eZdZeZd�Zd�Zd�Zy)�HistoricRecvlineLoopbackMixinc�>�|jdtzdzgd��S)Nsfirst line
�
done)rvrwrvrwrx)r�uprs r�testUpArrowz)HistoricRecvlineLoopbackMixin.testUpArrow�s'��� � ��b� �9�,�
�	
�		
rc�L�|jdtztzdzgd��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.
        sfirst line
partial liner�)rvrws>>> partial linespartial linerx�rr��downrs r�$test_DownArrowToPartialLineInHistoryzBHistoricRecvlineLoopbackMixin.test_DownArrowToPartialLineInHistory�s.��� � �-��2�T�9�I�E�
�	
�		
rc�R�|jdtdzztzdzgd��S)Nsfirst line
second line
r�r�)rvrw�>>> second liner�r�r�rxr�rs r�
testDownArrowz+HistoricRecvlineLoopbackMixin.testDownArrow�s0��� � �(�2��6�1�D�8�9�D�
�
�	
rN)r�r�r�r�r�r�r�r�rBrrr�r��s���N�

�
�.
rr�c��eZdZy)�#HistoricRecvlineLoopbackTelnetTestsNr�rBrrr�r����	rr�c��eZdZy)� HistoricRecvlineLoopbackSSHTestsNr�rBrrr�r�r�rr�zKTerminal requirements missing, can't run historic recvline tests over stdioc��eZdZy)�"HistoricRecvlineLoopbackStdioTestsNr�rBrrr�r�
s��	rr�c��eZdZdZd�Zy)�TransportSequenceTestsz5
    L{twisted.conch.recvline.TransportSequence}
    c�L�|jttj�y)zh
        Initializing a L{recvline.TransportSequence} with no args
        raises an assertion.
        N)�assertRaises�AssertionErrorr�TransportSequencers r�test_invalidSequencez+TransportSequenceTests.test_invalidSequences��
	
���.�(�*D�*D�ErN)r�r�r��__doc__r�rBrrr�r�s
���Frr�)er��osrT�unittestr�
twisted.conchr�twisted.conch.insultsr�twisted.credrrYrr�twisted.internet.testingr	�twisted.pythonr
rr�twisted.python.compatr
�twisted.python.reflectr�twisted.trial.unittestrrrR�dict�environr[�pathsep�join�pathrr�r��twisted.conch.test.loopbackr�r r�r}r�r�r�r|r�r�r�r�r��twisted.conch.manhole_sshr�r�r�r�r��twisted.conch.sshr�r�r�r�r�r�rr�r�r�r�r�r��SSHClientTransportr�r�r�r��registerAdapter�ISession�ImportErrorr�r�r�r�twisted.conch.testr5r(�TestProtocolr7rr:r<rJrtr�r�r�r�r�r�r�r�rBrr�<module>r�s���
�

�
��"�)��)�4�8�8�+�0�5��+�,�������	��*�*�/�/�#�(�(�3�	�,��DE�(�DE�N!�(�5�=��*�*�=���������	����	�����	�!�JH������C� 6��+�+� 6�D.��1�1�.�40�8�-�-�0�%1�	�4�4�%1�NG�7�G�0�o�0�
�<�
��J���{�H�g�6F�6F�G�
-�� 7� 7�
-�*�*�(4#�
�4#�n+�	�� 6� 6��8P�8P�	�	�� 6� 6��8P�8P�	�&�:�&�:;)�*�;)�|6
�6
�r	�,��:O�	�	�y�(�4I�	��E�	�W�X�	��h�8M�	�Y�	�2
�2
�j	��(�9�	�	�
�x�6�	��
�I�T��	���8�	�	�	�
F�X�
F��Y��
�C��s�J�J(�'J(

Zerion Mini Shell 1.0