%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�f�}��D�ddlZddlmZmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZddlmZddlmZddlmZddlmZmZddlmZd	�Zd
�Zd�Zd�Z e!�Z"d
�Z#d�Z$e$ddgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd �gejJd!��"�Z&e$d#ddd$gdd%gd&d'gd(d)gdd*gd+d,gd-d.gd/d0gd1d2gd3dgd4d5gd6d7gd8d9gd:d;gd<d=gd>d?ggejJd@��"�Z'GdA�dB�Z(GdC�dD�Z)dEZ*GdF�dGe)�Z+[*GdH�dIe+ejX�Z-GdJ�dKe+ejX�Z.GdL�dMe+ejX�Z/GdN�dOe+ejX�Z0GdP�dQejXe)�Z1GdR�dSejX�Z2y)T�N)�Optional�Type)
�BLINK�CS_ALTERNATE�CS_ALTERNATE_SPECIAL�
CS_DRAWING�CS_UK�CS_US�G0�G1�	UNDERLINE�ClientProtocol�ServerProtocol�modes�privateModes)�Protocol)�StringTransport)�	iterbytes)�
ValueConstant�Values)�unittestc�(�tt|�|�S�N)�super�Mock�__getattribute__)�mock�names  �A/usr/lib/python3/dist-packages/twisted/conch/test/test_insults.py�_getattrr s����t�-�d�3�3�c��t|d�S)N�occurrences�r �rs rr#r#"s���D�-�(�(r!c��t|d�S)N�methodsr$r%s rr'r'&s���D�)�$�$r!c�8�t|�j|�yr)r#�append)r�objs  r�_appendr+*s�������S�!r!c�8�tt|dz|zg��S)a
    Return the byte in 7- or 8-bit code table identified by C{column}
    and C{row}.

    "An 8-bit code table consists of 256 positions arranged in 16
    columns and 16 rows.  The columns and rows are numbered 00 to 15."

    "A 7-bit code table consists of 128 positions arranged in 8
    columns and 16 rows.  The columns are numbered 00 to 07 and the
    rows 00 to 15 (see figure 1)."

    p.5 of "Standard ECMA-35: Character Code Structure and Extension
    Techniques", 6th Edition (December 1994).
    �)�bytes�	bytearray)�column�rows  r�_ecmaCodeTableCoordinater21s ��"��V�q�[�C�/�0�1�2�2r!c���t|�D����cic]3\}}t|�D] \}}|r|tt||z|����"�5}}}}}||d<ttf|�Scc}}}}w)N�__doc__)�	enumeraterr2�typer)r�	colOffset�names�doc�jr1�i�attrss        r�_makeControlFunctionSymbolsr=Es��� ��&�
�
��A�s� ��~�
�
�A�t��	
�m�4�Q��]�A�F�G�G�
��
�E�
��E�)����v�i��'�'��
s�8A%
�CSFinalByter-)�ICH�DCH�HPA)�CUU�SSE�HPR)�CUD�CPR�REP)�CUF�SU�DA)�CUB�SD�VPA)�CNL�NP�VPR)�CPL�PP�HVP)�CHA�CTC�TBC)�CUP�ECH�SM)�CHT�CVT�MC)�ED�CBT�HPB)�EL�SRS�VPB)�IL�PTX�RM)�DL�SDS�SGR)�EF�SIMD�DSR)�EAN�DAQaW
    Symbolic constants for all control sequence final bytes
    that do not imply intermediate bytes.  This happens to cover
    movement control sequences.

    See page 11 of "Standard ECMA 48: Control Functions for Coded
    Character Sets", 5th Edition (June 1991).

    Each L{ValueConstant} maps a control sequence name to L{bytes}
    )r7r8r9�
C1SevenBit�DCS�PU1�BPH�PU2�NBH�STS�CCH�NEL�MW�SSA�SPA�ESA�EPA�HTS�SOS�HTJ�VTS�SCI�PLD�CSI�PLU�ST�RI�OSC�SS2�PM�SS3�APCa
    Symbolic constants for all 7 bit versions of the C1 control functions

    See page 9 "Standard ECMA 48: Control Functions for Coded
    Character Sets", 5th Edition (June 1991).

    Each L{ValueConstant} maps a control sequence name to L{bytes}
    c�(�eZdZeZdefd�Zd�Zd�Zy)rNc�H�g|_|�i}||_|tur||_yy)z�
        @param methods: Mapping of names to return values
        @param callReturnValue: object __call__ should return
        N)r#r'�default�callReturnValue)�selfr'r�s   r�__init__z
Mock.__init__�s2��
����?��G�����'�)�#2�D� �*r!c�b�t|d�}|tur
t�}t|d|||f�|S)Nr��__call__)r r�rr+)r��a�kw�returnValues    rr�z
Mock.__call__�s7���t�%6�7���'�!��&�K���z�;��2�6�7��r!c�v�t|d�}||vrt||��}n
t�}t|||f�|S)Nr')r�)r rr+)r�rr'�	attrValues    rrzMock.__getattribute__�s?���4��+���7�?��W�T�]�;�I���I���t�Y�'�(��r!)�__name__�
__module__�__qualname__r�r�r�r�r�r!rrr�s���O�#�W�
3��r!rc��eZdZdifd�Zy)�	MockMixinr�c��|\}}|j||�|jtt|��d�t|�\\}}}	}
|j|d�|j|	|�|j|
|�|S)N�r�)�assertEqual�lenr#)r��
occurrence�
methodName�expectedPositionalArgs�expectedKeywordArgs�attrr�call�result�argsr�s           r�
assertCallzMockMixin.assertCall�s��� �
��d�����z�*�����[��.�/��3�%0��%6�"�	!�$���b�����z�*�����5�6�����0�1��
r!N)r�r�r�r�r�r!rr�r��s
��=?�UW�
r!r�a�def testByte%(groupName)s(self):
    transport = StringTransport()
    proto = Mock()
    parser = self.protocolFactory(lambda: proto)
    parser.factory = self
    parser.makeConnection(transport)

    bytes = self.TEST_BYTES
    while bytes:
        chunk = bytes[:%(bytesPer)d]
        bytes = bytes[%(bytesPer)d:]
        parser.dataReceived(chunk)

    self.verifyResults(transport, proto, parser)
c�b�eZdZUdZeeeed<dD]\ZZ	e
eee	d�z��[[	d�Zy)�ByteGroupingsMixinN�protocolFactory))�Pairs�)�Triples�)�Quadsr-)�Quints�)�Sexes�)�	groupName�bytesPerc��|jt|�jd�d|f�}|jt|�g�y)Nr�makeConnection)r�r#�popr�)r��	transport�proto�parserr�s     r�
verifyResultsz ByteGroupingsMixin.verifyResults�s<������U�!3�!7�!7��!:�<L�v�i�X������V�,�b�1r!)
r�r�r�r�rrr�__annotations__�word�n�exec�_byteGroupingTestTemplater�r�r!rr�r��sM��04�O�X�d�8�n�-�4��M���a�	
�
&�t��)K�
K�L�M�	
�a�2r!r�c��eZdZeZdZd�Zy)�ServerArrowKeysTestssc�^�tj||||�|j|j|j|j
fD]J}|j
t|�jd�d|df�}|jt|�g��L|jt|��y)Nr�keystrokeReceived)r�r��UP_ARROW�
DOWN_ARROW�RIGHT_ARROW�
LEFT_ARROWr�r#r�r��assertFalse)r�r�r�r��arrowr�s      rr�z"ServerArrowKeysTests.verifyResults�s����(�(��y�%��H�
�O�O����������	
�		6�E��_�_��E�"�&�&�q�)�+>���
��F�
���[��0�"�5�		6�	
����U�+�,r!N�r�r�r�rr��
TEST_BYTESr�r�r!rr�r��s��$�O�-�J�
-r!r�c��eZdZeZdZd�Zy)�PrintableCharactersTestssabc123ABC!@#abc123c���tj||||�td�D]J}|jt	|�jd�d|df�}|j
t	|�g��Ltd�D]T}|jt	|�jd�d||jf�}|j
t	|�g��Vt	|�}|j||�d��y)Nsabc123ABC!@#rr�sabc123z should have been [])	r�r�rr�r#r�r��ALTr�)r�r�r�r��charr��occss       rr�z&PrintableCharactersTests.verifyResultss����(�(��y�%��H��o�.�	6�D��_�_��E�"�&�&�q�)�+>��t���F�
���[��0�"�5�		6��i�(�	6�D��_�_��E�"�&�&�q�)�+>��v�z�z�@R��F�
���[��0�"�5�		6��5�!������$��)=�>�?r!Nr�r�r!rr�r�s��$�O�
?�J�@r!r�c�z�eZdZdZeZgZdD]Zejdez��dje�Z
[[d�Zy)�ServerFunctionKeysTestsz9Test for parsing and dispatching function keys (F1 - F12))sOPsOQsORsOSs15~s17~s18~s19~s20~s21~s23~s24~�!c�:�tj||||�tdd�D]Z}t|d|fz�}|j	t|�j
d�d|df�}|jt|�g��\|jt|��y)Nr��
zF%drr�)	r�r��range�getattrr�r#r�r�r�)r�r�r�r��funcNum�funcArgr�s       rr�z%ServerFunctionKeysTests.verifyResults;s����(�(��y�%��H��Q��|�	6�G��f�e�w�j�&8�9�G��_�_��E�"�&�&�q�)�+>��$���F�
���[��0�"�5�	6�	
����U�+�,r!N)r�r�r�r4rr��byteList�	byteCodesr)�joinr�r�r�r!rr�r�#sM��C�$�O��H�
�.�	�	����9�,�-�.����(�#�J��)�-r!r�c�P�eZdZeZdZdZdZdZeezezezezezZ	[[[[d�Z
y)�ClientCursorMovementTestsssssc��tj||||�dD]O\}}|jt|�j	d�d|z|f�}|jt|�g��Q|j
t|��y)N))�Downr�)�Forwardr-��Upr���Backwardr�r�r�r�cursor)r�r�r�r#r�r�r�)r�r�r�r��method�countr�s       rr�z'ClientCursorMovementTests.verifyResultsQs����(�(��y�%��H�
�	6�M�F�E��_�_��E�"�&�&�q�)�8�f�+<�u�h��F�
���[��0�"�5�	6�	
����U�+�,r!N)r�r�r�rr��d2�r4�u1�l2r�r�r�r!rr�r�FsE��$�O�	�B�	�B�	�B�	�B��b��2���"�R�'�"�,�J�
�B��B�-r!r�c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�ClientControlSequencesTestsc���t��_t��_t	�fd���_��j
_�j
j�j��jt�j�jd�d�j
f�}�jt|��y)Nc����jSr)r��r�s�r�<lambda>z3ClientControlSequencesTests.setUp.<locals>.<lambda>gs���T�Z�Z�r!rr�)rr�rr�rr��factoryr�r�r#r�r�)r�r�s` r�setUpz!ClientControlSequencesTests.setUpds����(�*����V��
�$�%7�8���"��������"�"�4�>�>�2������
�
�#�'�'��*�,<�t�{�{�n�
��	
����V�,�-r!c�`�|jjdjd�td�D���t	|j
�}dD]I}dD]B}|j
|jd�d|z|f�}|jt	|���D�K|j|�y)Nr!c3�:K�|]}dD]}d|z|z����y�w))r!�2s20s200r�Nr�)�.0�chr�s   r�	<genexpr>zBClientControlSequencesTests.testSimpleCardinals.<locals>.<genexpr>qs6������3����1��r�!��!��s�sBACD)r�r�r�r�)r�r����rr�)	r��dataReceivedr�rr#r�r�r�r�)r�r��methr�r�s     r�testSimpleCardinalsz/ClientControlSequencesTests.testSimpleCardinalsos������ � ��H�H��#�G�,��
�	
��4�:�:�&��9�	6�D�(�
6��������!��h��o��x�P��� � ��V�!4�5�
6�	6�	
����r!c�v�|jjd�t|j�}|j	|jd�dd�}|j
t|��|j	|jd�dd�}|j
t|��|j
|�y)Ns
r�setScrollRegion)r��)NN�r�rr#r�r�r�r��r�r�r�s   r�testScrollRegionz,ClientControlSequencesTests.testScrollRegions������ � �!4�5��4�:�:�&��������!��.?��I������V�,�-�������!��.?��N������V�,�-�����r!c�b�|jjd�t|j�}|j	|jd�dd�}|j
t|��|j	|jd�dd�}|j
t|��|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j
|�y)Ns#3#4#5#6r�doubleHeightLine)T)F�singleWidthLine�doubleWidthLiner	r
s   r�testHeightAndWidthz.ClientControlSequencesTests.testHeightAndWidth�s������ � �!<�=��4�:�:�&��������!��.@�'�J������V�,�-�������!��.@�(�K������V�,�-�������!��.?�@������V�,�-�������!��.?�@������V�,�-�����r!c�"�|jjdjtd�D��cgc]0}djtd�D�cgc]
}d|z|z��c}���2c}}��t	|j
�}ttfD]`}tttttfD]@}|j|jd�d||f�}|jt	|���B�b|j|�ycc}wcc}}w)Nr!s()sAB012�r�selectCharacterSet)r�rr�rr#r�rrr	r
rrrr�r�r�)r��gr�r��which�charsetr�s       r�testCharacterSetz,ClientControlSequencesTests.testCharacterSet�s������ � ��H�H�'�u�-����H�H�y��7J�K�!�g��k�A�o�K�L��
�	
��4�:�:�&���"�X�	6�E�����$��

6������H�H�Q�K�!5���7G���� � ��V�!4�5�

6�	6�	
������'L��s�D�D�	D�Dc�r�|jjd�t|j�}|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j
|�y)Nsr�shiftIn�shiftOutr	r
s   r�testShiftingz(ClientControlSequencesTests.testShifting�s������ � ��-��4�:�:�&��������!��i�8������V�,�-�������!��j�9������V�,�-�����r!c�r�|jjd�t|j�}|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j
|�y)NsNOr�singleShift2�singleShift3r	r
s   r�testSingleShiftsz,ClientControlSequencesTests.testSingleShifts�s������ � ��/��4�:�:�&��������!��n�=������V�,�-�������!��n�=������V�,�-�����r!c�r�|jjd�t|j�}|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j
|�y)Ns=>r�applicationKeypadMode�numericKeypadModer	r
s   r�testKeypadModez*ClientControlSequencesTests.testKeypadMode�s������ � ��/��4�:�:�&��������!��.E�F������V�,�-�������!��.A�B������V�,�-�����r!c�r�|jjd�t|j�}|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j
|�y)Ns78r�
saveCursor�
restoreCursorr	r
s   r�
testCursorz&ClientControlSequencesTests.testCursor�s������ � ��/��4�:�:�&��������!��l�;������V�,�-�������!��o�>������V�,�-�����r!c��|jjd�t|j�}|j	|jd�d�}|j
t|��|j
|�y)Nscr�resetr	r
s   r�	testResetz%ClientControlSequencesTests.testReset�s[����� � ��*��4�:�:�&��������!��g�6������V�,�-�����r!c���|jjd�t|j�}|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j	|jd�d�}|j
t|��|j
|�y)NsDMEr�index�reverseIndex�nextLiner	r
s   r�	testIndexz%ClientControlSequencesTests.testIndex�s������ � �!3�4��4�:�:�&��������!��g�6������V�,�-�������!��n�=������V�,�-�������!��j�9������V�,�-�����r!c	��|jjddjd�tjtj
tjfD��zdz�|jjddjd�tjtj
tjfD��zdz�t|j�}|j|jd�dtjtj
tjgf�}|jt|��|j|jd�d	tjtj
tjgf�}|jt|��|j|�y)
Nr��;c3�(K�|]
}d|fz���y�w�s%dNr��r��ms  rrz8ClientControlSequencesTests.testModes.<locals>.<genexpr>������P������P����hc3�(K�|]
}d|fz���y�wr3r�r4s  rrz8ClientControlSequencesTests.testModes.<locals>.<genexpr>�r6r7�lr�setModes�
resetModes)r�rr�r�KAM�IRM�LNMr#r�r�r�r�r
s   r�	testModesz%ClientControlSequencesTests.testModes�sB����� � ���i�i�P�u�y�y�%�)�)�U�Y�Y�.O�P�P�
Q��
�	
�
	
��� � ���i�i�P�u�y�y�%�)�)�U�Y�Y�.O�P�P�
Q��
�	
�
�4�:�:�&������H�H�Q�K��u�y�y�%�)�)�U�Y�Y�&G�%I�
��	
����V�,�-�����H�H�Q�K�����E�I�I�u�y�y�(I�'K�
��	
����V�,�-�����r!c��|jjd�t|j�}dD]=}|j	|jd�|�}|j
t|���?|j	|jd�dd�}|j
t|��|j
|�y)Ns)�eraseToLineEnd�eraseToLineBeginning�	eraseLine�eraseToDisplayEnd�eraseToDisplayBeginning�eraseDisplayr�deleteCharacter)r�r	)r�r�rr�s    r�testErasurez'ClientControlSequencesTests.testErasures������ � �!S�T��4�:�:�&��
�		2�D��_�_�T�X�X�a�[�$�7�F����[��0�1�		2�������!��.?��F������V�,�-�����r!c��|jjd�t|j�}dD]?}|j	|jd�d|f�}|j
t|���A|j
|�y)Ns�r�r�r�
deleteLiner	�r�r��argr�s    r�testLineDeletionz,ClientControlSequencesTests.testLineDeletion!�q����� � �!1�2��4�:�:�&���	2�C��_�_�T�X�X�a�[�,���G�F����[��0�1�	2�	
����r!c��|jjd�t|j�}dD]?}|j	|jd�d|f�}|j
t|���A|j
|�y)NsrKr�
insertLiner	rMs    r�testLineInsertionz-ClientControlSequencesTests.testLineInsertion*rPr!c�N�dt|j�d<|jjd�|j	|j
j
�d�t|j�}|j|jd�d�}|j	|d�y)N)r���reportCursorPositionssr)
r'r�r�rr�r��valuer#r�r�r
s   r�testCursorPositionz.ClientControlSequencesTests.testCursorPosition3s~��6<���
�
��2�3���� � ��,�������-�-�/��>��4�:�:�&��������!��.D�E��	
�����(r!c�"�t|j�}|jjd�|j	|jd�dd�|jjd�|j	|jd�dd�y)z�
        Contiguous non-control bytes are passed to a single call to the
        C{write} method of the terminal to which the L{ClientProtocol} is
        connected.
        �ar�write)rZ�bc)r\N)r#r�r�rr�r�)r�r�s  r�test_applicationDataBytesz5ClientControlSequencesTests.test_applicationDataBytes>sf���4�:�:�&����� � ��&���������W�g�6���� � ��'���������W�h�7r!c��t|j�}|jj|�|r4|j|jd�g|jd����|r�4|j
|d|���y)NrzNo other calls should happen: )r#r�r�rr�r�r�)r��data�callsr�s    r�_applicationDataTestz0ClientControlSequencesTests._applicationDataTestJse���4�:�:�&����� � ��&���D�O�O�D�H�H�Q�K�7�%�)�)�A�,�7������!?��x�H�Ir!c�,�|jdddg�y)z�
        Application data bytes followed by a shift-in command are passed to a
        call to C{write} before the terminal's C{shiftIn} method is called.
        sab�r[)sab)rN�rar�s r� test_shiftInAfterApplicationDataz<ClientControlSequencesTests.test_shiftInAfterApplicationDataQs��
	
�!�!�)�.A�<�-P�Qr!c�,�|jdddg�y)z�
        Application data bytes followed by a shift-out command are passed to a
        call to C{write} before the terminal's C{shiftOut} method is called.
        sabrc)rNrdr�s r�!test_shiftOutAfterApplicationDataz=ClientControlSequencesTests.test_shiftOutAfterApplicationDataXs��
	
�!�!�)�.A�=�-Q�Rr!c�,�|jdddg�y)z�
        Application data bytes followed by a cursor-backward command are passed
        to a call to C{write} before the terminal's C{cursorBackward} method is
        called.
        sabrc)�cursorBackwardNrdr�s r�'test_cursorBackwardAfterApplicationDatazCClientControlSequencesTests.test_cursorBackwardAfterApplicationData_s��	
�!�!�)�.A�CV�-W�Xr!c�\�|jdddg�|jddddgffg�y)z�
        Application data bytes followed by an escape character are passed to a
        call to C{write} before the terminal's handler method for the escape is
        called.
        sabDrc)r,sabr;r-Nrdr�s r�test_escapeAfterApplicationDataz;ClientControlSequencesTests.test_escapeAfterApplicationDatags>��	
�!�!�*�/B�J�.O�P�	
�!�!��.��q�c�V�0D�E�	
r!N)r�r�r�r�rrrrrrr#r'r*r/r@rIrOrSrXr]rarergrjrlr�r!rr�r�cst��	.�� 	��"�2	�	�	�	����0�&��	)�
8�J�R�S�Y�
r!r�c���eZdZdZedd�Zeedd�zZd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%y$)%�ServerProtocolOutputTestszh
    Tests for the bytes L{ServerProtocol} writes to its transport when its
    methods are called.
    r��r�c��t�|_t�|_|jj	|j�yr)r�protocolrr�r�r�s rr�zServerProtocolOutputTests.setUp�s,��&�(��
�(�*����
�
�$�$�T�^�^�4r!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.cursorUp} writes the control sequence
        ending with L{CSFinalByte.CUU} to its transport.
        r��1N)rq�cursorUpr�r�rWr�r>rBr�s r�
test_cursorUpz'ServerProtocolOutputTests.test_cursorUp�sM��
	
�
�
���q�!�����N�N� � �"�D�H�H�t�O�k�o�o�6K�6K�$K�	
r!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.cursorDown} writes the control sequence
        ending with L{CSFinalByte.CUD} to its transport.
        r�rsN)rq�
cursorDownr�r�rWr�r>rEr�s r�test_cursorDownz)ServerProtocolOutputTests.test_cursorDown�sM��
	
�
�
� � ��#�����N�N� � �"�D�H�H�t�O�k�o�o�6K�6K�$K�	
r!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.cursorForward} writes the control sequence
        ending with L{CSFinalByte.CUF} to its transport.
        r�rsN)rq�
cursorForwardr�r�rWr�r>rHr�s r�test_cursorForwardz,ServerProtocolOutputTests.test_cursorForward�sM��
	
�
�
�#�#�A�&�����N�N� � �"�D�H�H�t�O�k�o�o�6K�6K�$K�	
r!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.cursorBackward} writes the control sequence
        ending with L{CSFinalByte.CUB} to its transport.
        r�rsN)rqrir�r�rWr�r>rKr�s r�test_cursorBackwardz-ServerProtocolOutputTests.test_cursorBackward�sM��
	
�
�
�$�$�Q�'�����N�N� � �"�D�H�H�t�O�k�o�o�6K�6K�$K�	
r!c���|jjdd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.cursorPosition} writes a control sequence
        ending with L{CSFinalByte.CUP} and containing the expected
        coordinates to its transport.
        rs1;1N)rq�cursorPositionr�r�rWr�r>rWr�s r�test_cursorPositionz-ServerProtocolOutputTests.test_cursorPosition�sP��	
�
�
�$�$�Q��*�����N�N� � �"�D�H�H�v�$5����8M�8M�$M�	
r!c���|jj�|j|jj	�|j
tjjz�y)z�
        L{ServerProtocol.cursorHome} writes a control sequence ending
        with L{CSFinalByte.CUP} and no parameters, so that the client
        defaults to (1, 1).
        N)rq�
cursorHomer�r�rWr�r>rWr�s r�test_cursorHomez)ServerProtocolOutputTests.test_cursorHome�sD��	
�
�
� � �"�������-�-�/����K�O�O�<Q�<Q�1Q�Rr!c��|jj�|j|jj	�|j
t
dd�z�y)z�
        L{ServerProtocol.index} writes the control sequence ending in
        the 8-bit code table coordinates 4, 4.

        Note that ECMA48 5th Edition removes C{IND}.
        r-N)rqr,r�r�rW�ESCr2r�s r�
test_indexz$ServerProtocolOutputTests.test_index�sE��	
�
�
��������N�N� � �"�D�H�H�/G��1�/M�$M�	
r!c���|jj�|j|jj	�|j
tjjz�y)zt
        L{ServerProtocol.reverseIndex} writes the control sequence
        ending in the L{C1SevenBit.RI}.
        N)rqr-r�r�rWr�rnr�r�s r�test_reverseIndexz+ServerProtocolOutputTests.test_reverseIndex�sD��
	
�
�
�"�"�$�������-�-�/����J�M�M�<O�<O�1O�Pr!c��|jj�|j|jj	�d�y)zM
        L{ServerProtocol.nextLine} writes C{"
"} to its transport.
        s
N)rqr.r�r�rWr�s r�
test_nextLinez'ServerProtocolOutputTests.test_nextLine�s1��	
�
�
��� �������-�-�/��9r!c�h�tjtjtjg}|jj|�|j
|jj�|jdjd�|D��ztjjz�y)z�
        L{ServerProtocol.setModes} writes a control sequence
        containing the requested modes and ending in the
        L{CSFinalByte.SM}.
        r1c3�(K�|]
}d|fz���y�wr3r�r4s  rrz:ServerProtocolOutputTests.test_setModes.<locals>.<genexpr>������9������9�r7N)
rr=r>r?rqr;r�r�rWr�r�r>rY�r��
modesToSets  r�
test_setModesz'ServerProtocolOutputTests.test_setModes�s|���i�i����E�I�I�6�
��
�
���z�*�����N�N� � �"��H�H��i�i�9�j�9�9�
:��n�n�"�"�
#�	
r!c�h�tjtjtjg}|jj|�|j
|jj�|jdjd�|D��ztjjz�y)z�
        L{ServerProtocol.setPrivatesModes} writes a control sequence
        containing the requested private modes and ending in the
        L{CSFinalByte.SM}.
        r1c3�(K�|]
}d|fz���y�wr3r�r4s  rrzAServerProtocolOutputTests.test_setPrivateModes.<locals>.<genexpr>s����@������@�r7N)
r�ERROR�COLUMN�ORIGINrqr;r�r�rWr�r�r>rY)r��privateModesToSets  r�test_setPrivateModesz.ServerProtocolOutputTests.test_setPrivateModes�s���
���������
��
	
�
�
���0�1�����N�N� � �"��H�H��i�i�@�.?�@�@�
A��n�n�"�"�
#�	
r!c�h�tjtjtjg}|jj|�|j
|jj�|jdjd�|D��ztjjz�y)zs
        L{ServerProtocol.resetModes} writes the control sequence
        ending in the L{CSFinalByte.RM}.
        r1c3�(K�|]
}d|fz���y�wr3r�r4s  rrz<ServerProtocolOutputTests.test_resetModes.<locals>.<genexpr>r�r7N)
rr=r>r?rqr<r�r�rWr�r�r>rer�s  r�test_resetModesz)ServerProtocolOutputTests.test_resetModess|��
�i�i����E�I�I�6�
��
�
� � ��,�����N�N� � �"��H�H��i�i�9�j�9�9�
:��n�n�"�"�
#�	
r!c���|jj�|j|jj	�|j
tjjz�y)zp
        L{ServerProtocol.singleShift2} writes an escape sequence
        followed by L{C1SevenBit.SS2}
        N)rqrr�r�rWr�rnr�r�s r�test_singleShift2z+ServerProtocolOutputTests.test_singleShift2�D��
	
�
�
�"�"�$�������-�-�/����J�N�N�<P�<P�1P�Qr!c���|jj�|j|jj	�|j
tjjz�y)zp
        L{ServerProtocol.singleShift3} writes an escape sequence
        followed by L{C1SevenBit.SS3}
        N)rqrr�r�rWr�rnr�r�s r�test_singleShift3z+ServerProtocolOutputTests.test_singleShift3r�r!c�.�|jjtt�tt��|j|jj�|jdttfzztjjz�y)z�
        L{ServerProtocol.selectGraphicRendition} writes a control
        sequence containing the requested attributes and ending with
        L{CSFinalByte.SGR}
        s%d;%dN)rq�selectGraphicRendition�strrr
r�r�rWr�r>rhr�s r�test_selectGraphicRenditionz5ServerProtocolOutputTests.test_selectGraphicRendition$sc��	
�
�
�,�,�S��Z��Y��H�����N�N� � �"��H�H�x�5�)�"4�4�4�{���7L�7L�L�	
r!c���|jj�|j|jj	�|j
tjjz�y)zz
        L{ServerProtocol.horizontalTabulationSet} writes the escape
        sequence ending in L{C1SevenBit.HTS}
        N)rq�horizontalTabulationSetr�r�rWr�rnr|r�s r�test_horizontalTabulationSetz6ServerProtocolOutputTests.test_horizontalTabulationSet0sD��
	
�
�
�-�-�/�������-�-�/����J�N�N�<P�<P�1P�Qr!c���|jj�|j|jj	�|j
tjjz�y)a
        L{ServerProtocol.eraseToLineEnd} writes the control sequence
        sequence ending in L{CSFinalByte.EL} and no parameters,
        forcing the client to default to 0 (from the active present
        position's current location to the end of the line.)
        N)rqrBr�r�rWr�r>r`r�s r�test_eraseToLineEndz-ServerProtocolOutputTests.test_eraseToLineEnd8sD��	
�
�
�$�$�&�������-�-�/����K�N�N�<P�<P�1P�Qr!c���|jj�|j|jj	�|j
dztjjz�y)a	
        L{ServerProtocol.eraseToLineBeginning} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 1 (from the beginning of the line up to and include the
        active present position's current location.)
        rsN)rqrCr�r�rWr�r>r`r�s r�test_eraseToLineBeginningz3ServerProtocolOutputTests.test_eraseToLineBeginningBsH��	
�
�
�*�*�,�������-�-�/����D��;�>�>�CW�CW�1W�Xr!c���|jj�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.eraseLine} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 2 (the entire line.)
        r�N)rqrDr�r�rWr�r>r`r�s r�test_eraseLinez(ServerProtocolOutputTests.test_eraseLineLsH��	
�
�
���!�������-�-�/����D��;�>�>�CW�CW�1W�Xr!c���|jj�|j|jj	�|j
tjjz�y)a
        L{ServerProtocol.eraseToDisplayEnd} writes the control
        sequence sequence ending in L{CSFinalByte.ED} and no parameters,
        forcing the client to default to 0 (from the active present
        position's current location to the end of the page.)
        N)rqrEr�r�rWr�r>r]r�s r�test_eraseToDisplayEndz0ServerProtocolOutputTests.test_eraseToDisplayEndUsD��	
�
�
�'�'�)�������-�-�/����K�N�N�<P�<P�1P�Qr!c���|jj�|j|jj	�|j
dztjjz�y)a
        L{ServerProtocol.eraseToDisplayBeginning} writes the control
        sequence sequence ending in L{CSFinalByte.ED} a parameter of 1
        (from the beginning of the page up to and include the active
        present position's current location.)
        rsN)rqrFr�r�rWr�r>r]r�s r�test_eraseToDisplayBeginningz6ServerProtocolOutputTests.test_eraseToDisplayBeginning_sH��	
�
�
�-�-�/�������-�-�/����D��;�>�>�CW�CW�1W�Xr!c���|jj�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.eraseDisplay} writes the control sequence
        sequence ending in L{CSFinalByte.ED} a parameter of 2 (the
        entire page)
        r�N)rqrGr�r�rWr�r>r]r�s r�test_eraseToDisplayz-ServerProtocolOutputTests.test_eraseToDisplayisH��	
�
�
�"�"�$�������-�-�/����D��;�>�>�CW�CW�1W�Xr!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.deleteCharacter} writes the control sequence
        containing the number of characters to delete and ending in
        L{CSFinalByte.DCH}
        r-�4N)rqrHr�r�rWr�r>r@r�s r�test_deleteCharacterz.ServerProtocolOutputTests.test_deleteCharacterrsM��	
�
�
�%�%�a�(�����N�N� � �"�D�H�H�t�O�k�o�o�6K�6K�$K�	
r!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.insertLine} writes the control sequence
        containing the number of lines to insert and ending in
        L{CSFinalByte.IL}
        r��5N)rqrRr�r�rWr�r>rcr�s r�test_insertLinez)ServerProtocolOutputTests.test_insertLine}�J��	
�
�
� � ��#�������-�-�/����D��;�>�>�CW�CW�1W�Xr!c���|jjd�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.deleteLine} writes the control sequence
        containing the number of lines to delete and ending in
        L{CSFinalByte.DL}
        r��6N)rqrLr�r�rWr�r>rfr�s r�test_deleteLinez)ServerProtocolOutputTests.test_deleteLine�r�r!c��|jj�|j|jj	�|j
dzdz�y)z�
        With no arguments, L{ServerProtocol.setScrollRegion} writes a
        control sequence with no parameters, but a parameter
        separator, and ending in C{b'r'}.
        r1�rN�rqrr�r�rWr�r�s r�test_setScrollRegionNoArgsz4ServerProtocolOutputTests.test_setScrollRegionNoArgs�s>��	
�
�
�%�%�'�������-�-�/����D��4�1G�Hr!c��|jjd��|j|jj	�|j
dzdz�y)z�
        With just a value for its C{first} argument,
        L{ServerProtocol.setScrollRegion} writes a control sequence with
        that parameter, a parameter separator, and finally a C{b'r'}.
        r�)�firsts1;r�Nr�r�s r�test_setScrollRegionJustFirstz7ServerProtocolOutputTests.test_setScrollRegionJustFirst�sD��	
�
�
�%�%�A�%�.�������-�-�/����E�1A�D�1H�Ir!c��|jjd��|j|jj	�|j
dzdz�y)z�
        With just a value for its C{last} argument,
        L{ServerProtocol.setScrollRegion} writes a control sequence with
        a parameter separator, that parameter, and finally a C{b'r'}.
        r�)�lasts;1r�Nr�r�s r�test_setScrollRegionJustLastz6ServerProtocolOutputTests.test_setScrollRegionJustLast�sD��	
�
�
�%�%�1�%�-�������-�-�/����E�1A�D�1H�Ir!c��|jjdd��|j|jj	�|j
dzdz�y)z�
        When given both C{first} and C{last}
        L{ServerProtocol.setScrollRegion} writes a control sequence with
        the first parameter, a parameter separator, the last
        parameter, and finally a C{b'r'}.
        r�r�)r�r�s1;2r�Nr�r�s r� test_setScrollRegionFirstAndLastz:ServerProtocolOutputTests.test_setScrollRegionFirstAndLast�sF��	
�
�
�%�%�A�A�%�6�������-�-�/����F�1B�T�1I�Jr!c���|jj�|j|jj	�|j
dztjjz�y)z�
        L{ServerProtocol.reportCursorPosition} writes a control
        sequence ending in L{CSFinalByte.DSR} with a parameter of 6
        (the Device Status Report returns the current active
        position.)
        r�N)rqrVr�r�rWr�r>rkr�s r�test_reportCursorPositionz3ServerProtocolOutputTests.test_reportCursorPosition�sK��	
�
�
�*�*�,�����N�N� � �"�D�H�H�t�O�k�o�o�6K�6K�$K�	
r!N)&r�r�r�r4r2r�r�r�rurxr{r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!rrnrnys����#�1�b�
)�C�

�(��B�/�
/�C�5�

�
�
�
�	
�S�

�Q�:�

�
�&
�R�R�

�R�R�Y�Y�R�Y�Y�	
�Y�Y�I�J�J�K�

r!rn)3�textwrap�typingrr�twisted.conch.insults.insultsrrrrr	r
rrr
rrrr�twisted.internet.protocolr�twisted.internet.testingr�twisted.python.compatr�twisted.python.constantsrr�
twisted.trialrr r#r'r+�objectr�r2r=�dedentr>rnrr�r�r��TestCaser�r�r�r�r�rnr�r!r�<module>r�s��
�!�����/�4�+�:�"�4�)�%�"��(��3�((�*���	����������������#�&	����		�	�-"��J)���	
�u�
�	
�u�
�	���	���	
�u�
�	��
�	���	���	���	��
�	���	���	��
�	
�u�
�	��
�	���!�$	����	�		�+�
�D��D����$2��2�$�-�-�x�/@�/@�-�,@�1�8�3D�3D�@�6 -�0�(�2C�2C� -�F-� 2�H�4E�4E�-�:P
�(�"3�"3�Y�P
�lE
�� 1� 1�E
r!

Zerion Mini Shell 1.0