HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/conch/test/__pycache__/test_insults.cpython-38.pyc
U


W[-��@s�ddlmZddlmZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZmZddlmZmZdd	lmZmZdd
lZdd�Zd
d�Zdd�Zdd�Ze�Z dd�Z!dd�Z"e"dddddgdddgdd d!gd"d#d$gd%d&d'gd(d)d*gd+d,d-gd.d/d0gd1d2d3gd4d5d6gd7d8d9gd:d;d<gd=d>d?gd@dAdBgdCdDdEgdFd
dGgge�#dH�dI�Z$e"dJdd
dKgd
dLgdMdNgdOdPgd
dQgdRdSgdTdUgdVdWgdXdYgdZd
gd[d\gd]d^gd_d`gdadbgdcddgdedfgge�#dg�dI�Z%Gdhdi�die�Z&Gdjdk�dk�Z'dlZ(Gdmdn�dne'�Z)[(Gdodp�dpe)ej*�Z+Gdqdr�dre)ej*�Z,Gdsdt�dte)ej*�Z-Gdudv�dve)ej*�Z.Gdwdx�dxej*e'�Z/Gdydz�dzej*�Z0Gd{d|�d|ej*�Z1d
S)}�)�namedAny)�unittest)�StringTransport)�ServerProtocol�ClientProtocol)�CS_UK�CS_US�
CS_DRAWING�CS_ALTERNATE�CS_ALTERNATE_SPECIAL�BLINK�	UNDERLINE)�G0�G1)�modes�privateModes)�
intToBytes�	iterbytes)�
ValueConstant�ValuesNcCstt|��|�S�N)�super�Mock�__getattribute__)�mock�name�r�A/usr/lib/python3/dist-packages/twisted/conch/test/test_insults.py�_getattrsrcCs
t|d�S)N�occurrences�r�rrrrrsrcCs
t|d�S)N�methodsr r!rrrr"sr"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�_ecmaCodeTableCoordinate(sr+cs,�fdd�t|�D�}||d<t|tf|�S)Ncs:i|]2\}}t|�D] \}}|r|tt|�|���qqSr)�	enumeraterr+)�.0�jr*�ir��	colOffsetrr�
<dictcomp>As
�z/_makeControlFunctionSymbols.<locals>.<dictcomp>�__doc__)r,�typer)rr1�names�docZattrsrr0r�_makeControlFunctionSymbols<s

�r7�CSFinalByter&ZICH�DCHZHPA�CUUZSSEZHPR�CUDZCPRZREP�CUFZSUZDA�CUBZSDZVPAZCNLZNPZVPRZCPLZPPZHVPZCHAZCTCZTBC�CUPZECH�SMZCHTZCVTZMC�EDZCBTZHPB�ELZSRSZVPB�ILZPTX�RM�DLZSDS�SGRZEFZSIMD�DSRZEAZDAQaW
    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}
    )r1r5r6�
C1SevenBitZDCSZPU1ZBPHZPU2ZNBHZSTSZCCHZNELZMWZSSAZSPAZESAZEPA�HTSZSOSZHTJZVTSZSCIZPLD�CSIZPLUZST�RIZOSC�SS2ZPM�SS3ZAPCa
    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|_|dkri}||_|tk	r&||_dS)z�
        @param methods: Mapping of names to return values
        @param callReturnValue: object __call__ should return
        N)rr"�default�callReturnValue)�selfr"rNrrr�__init__�sz
Mock.__init__cOs.t|d�}|tkrt�}t|d|||f�|S)NrN�__call__)rrMrr%)rO�a�kwZreturnValuerrrrQ�s

z
Mock.__call__cCs:t|d�}||kr"t||d�}nt�}t|||f�|S)Nr")rN)rrr%)rOrr"Z	attrValuerrrr�s
zMock.__getattribute__)�__name__�
__module__�__qualname__rMrNrPrQrrrrrr�s
	rc@seZdZdifdd�ZdS)�	MockMixinrcCsb|\}}|�||�|�tt|��d�t|�\\}}}	}
|�|d�|�|	|�|�|
|�|S)N�rQ)�assertEqual�lenr)rOZ
occurrenceZ
methodNameZexpectedPositionalArgsZexpectedKeywordArgs�attrr�call�result�argsrSrrr�
assertCall�szMockMixin.assertCallN)rTrUrVr_rrrrrW�s�rWa�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@s<eZdZdZdD]\ZZeeeed��q[[dd�ZdS)�ByteGroupingsMixinN))ZPairs�)ZTriples�)ZQuadsr&)ZQuints�)ZSexes�)Z	groupNameZbytesPercCs.|�t|��d�d|f�}|�t|�g�dS)Nr�makeConnection)r_r�poprY)rO�	transport�proto�parserr]rrr�
verifyResults�sz ByteGroupingsMixin.verifyResults)	rTrUrV�protocolFactoryZword�n�exec�_byteGroupingTestTemplaterjrrrrr`�s
r`c@seZdZeZdZdd�ZdS)�ServerArrowKeysTestsscCsht�||||�|j|j|j|jfD]0}|�t|��d�d|df�}|�	t|�g�q$|�
t|��dS)Nr�keystrokeReceived)r`rjZUP_ARROWZ
DOWN_ARROWZRIGHT_ARROWZ
LEFT_ARROWr_rrfrY�assertFalse)rOrgrhriZarrowr]rrrrj�s�z"ServerArrowKeysTests.verifyResultsN�rTrUrVrrk�
TEST_BYTESrjrrrrro�sroc@seZdZeZdZdd�ZdS)�PrintableCharactersTestssabc123ABC!@#abc123cCs�t�||||�td�D]0}|�t|��d�d|df�}|�t|�g�qtd�D]2}|�t|��d�d||jf�}|�t|�g�qRt|�}|�|d|f�dS)Nsabc123ABC!@#rrpsabc123z%r should have been [])	r`rjrr_rrfrYZALTrq)rOrgrhri�charr]�occsrrrrj�sz&PrintableCharactersTests.verifyResultsNrrrrrrrt�srtc@sFeZdZdZeZgZdD]Ze�de�qd�	e�Z
[[dd�ZdS)�ServerFunctionKeysTestsz>Test 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)NrX�
zF%drrp)	r`rj�range�getattrr_rrfrYrq)rOrgrhriZfuncNumZfuncArgr]rrrrjsz%ServerFunctionKeysTests.verifyResultsN)rTrUrVr3rrkZbyteListZ	byteCodesr#�joinrsrjrrrrrws
rwc@sHeZdZeZdZdZdZdZeeeeeeZ	[[[[dd�Z
dS)�ClientCursorMovementTestssssscCs^t�||||�dD]6\}}|�t|��d�d||f�}|�t|�g�q|�t|��dS)N))�Downra)�Forwardr&��UprX��Backwardrar�r�r�cursor)r`rjr_rrfrYrq)rOrgrhri�method�countr]rrrrj$s
z'ClientCursorMovementTests.verifyResultsN)rTrUrVrrkZd2Zr4Zu1�l2rsrjrrrrr~sr~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)rhr�rOrr�<lambda>3ryz3ClientControlSequencesTests.setUp.<locals>.<lambda>rre)rrgrrhrri�factoryrer_rrfrq)rOr]rr�r�setUp0sz!ClientControlSequencesTests.setUpcCst|j�d�dd�td�D���t|j�}dD]6}dD],}|�|�d�d||f�}|�t|��q6q.|�|�dS)	Nryc
s8g|]0�d��fdd�dtd�td�td�fD���qS)rycsg|]}d|��qS)rxr�r-rl�Zchrr�
<listcomp><s�zNClientControlSequencesTests.testSimpleCardinals.<locals>.<listcomp>.<listcomp>ra���)r}r�r-rr�rr�<s��zCClientControlSequencesTests.testSimpleCardinals.<locals>.<listcomp>sBACD)rr�r�r�)rXrar�r�rr�)	ri�dataReceivedr}rrrhr_rfrq)rOrv�methr�r]rrr�testSimpleCardinals9s���
z/ClientControlSequencesTests.testSimpleCardinalscCsh|j�d�t|j�}|�|�d�dd�}|�t|��|�|�d�dd�}|�t|��|�|�dS)Ns
r�setScrollRegion)rc�)NN�rir�rrhr_rfrq�rOrvr]rrr�testScrollRegionHs
z,ClientControlSequencesTests.testScrollRegioncCs�|j�d�t|j�}|�|�d�dd�}|�t|��|�|�d�dd�}|�t|��|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)Ns#3#4#5#6rZdoubleHeightLine)T)FZsingleWidthLineZdoubleWidthLiner�r�rrr�testHeightAndWidthSs
z.ClientControlSequencesTests.testHeightAndWidthcCs�|j�d�dd�td�D���t|j�}ttfD]>}tt	t
ttfD]*}|�
|�d�d||f�}|�t|��qDq2|�|�dS)Nrycs(g|] �d��fdd�td�D���qS)rycsg|]}d�|�qS)�rr���grrr�gszKClientControlSequencesTests.testCharacterSet.<locals>.<listcomp>.<listcomp>sAB012)r}rr�rr�rr�gs�z@ClientControlSequencesTests.testCharacterSet.<locals>.<listcomp>s()rZselectCharacterSet)rir�r}rrrhrrrrr	r
rr_rfrq)rOrvZwhich�charsetr]rrr�testCharacterSetds���
z,ClientControlSequencesTests.testCharacterSetcCsd|j�d�t|j�}|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)Nsr�shiftIn�shiftOutr�r�rrr�testShiftingss
z(ClientControlSequencesTests.testShiftingcCsd|j�d�t|j�}|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)NsNOr�singleShift2�singleShift3r�r�rrr�testSingleShiftss
z,ClientControlSequencesTests.testSingleShiftscCsd|j�d�t|j�}|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)Ns=>rZapplicationKeypadModeZnumericKeypadModer�r�rrr�testKeypadMode�s
z*ClientControlSequencesTests.testKeypadModecCsd|j�d�t|j�}|�|�d�d�}|�t|��|�|�d�d�}|�t|��|�|�dS)Ns78rZ
saveCursorZ
restoreCursorr�r�rrr�
testCursor�s
z&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�tttjtjtjg��d�|j�dd�tttjtjtjg��d�t	|j
�}|�|�d�dtjtjtjgf�}|�
t	|��|�|�d�dtjtjtjgf�}|�
t	|��|�
|�dS)Nrx�;�h�lr�setModes�
resetModes)rir�r}�maprr�KAM�IRM�LNMrrhr_rfrqr�rrr�	testModes�s"�"�
""z%ClientControlSequencesTests.testModescCsp|j�d�t|j�}dD]$}|�|�d�|�}|�t|��q|�|�d�dd�}|�t|��|�|�dS)Ns)�eraseToLineEnd�eraseToLineBeginning�	eraseLine�eraseToDisplayEnd�eraseToDisplayBeginning�eraseDisplayr�deleteCharacter)rbr�)rOrvr�r]rrr�testErasure�s�
z'ClientControlSequencesTests.testErasurecCsR|j�d�t|j�}dD](}|�|�d�d|f�}|�t|��q|�|�dS)Ns�rXrbr�
deleteLiner��rOrv�argr]rrr�testLineDeletion�s
z,ClientControlSequencesTests.testLineDeletioncCsR|j�d�t|j�}dD](}|�|�d�d|f�}|�t|��q|�|�dS)Nsr�r�
insertLiner�r�rrr�testLineInsertion�s
z-ClientControlSequencesTests.testLineInsertioncCsXdt|j�d<|j�d�|�|j��d�t|j�}|�|�	d�d�}|�|d�dS)N)rd��reportCursorPositionssr)
r"rhrir�rYrg�valuerr_rfr�rrr�testCursorPosition�s
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)r��bc)r�N)rrhrir�r_rf)rOrvrrr�test_applicationDataBytes�s

z5ClientControlSequencesTests.test_applicationDataBytescCsNt|j�}|j�|�|r8|j|�d�f|�d���q|�|d|f�dS)Nrz No other calls should happen: %r)rrhrir�r_rfrq)rO�dataZcallsrvrrr�_applicationDataTests

z0ClientControlSequencesTests._applicationDataTestcCs|�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�r�)sab)r�N�r�r�rrr� test_shiftInAfterApplicationDatas��z<ClientControlSequencesTests.test_shiftInAfterApplicationDatacCs|�dddg�dS)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�)r�Nr�r�rrr�!test_shiftOutAfterApplicationDatas��z=ClientControlSequencesTests.test_shiftOutAfterApplicationDatacCs|�dddg�dS)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%s��zCClientControlSequencesTests.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�)r�sabr�r&Nr�r�rrr�test_escapeAfterApplicationData1s��
��z;ClientControlSequencesTests.test_escapeAfterApplicationDataN)rTrUrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�/s,		


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.
    rX�rccCs"t�|_t�|_|j�|j�dSr)r�protocolrrgrer�rrrr�SszServerProtocolOutputTests.setUpcCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.cursorUp} writes the control sequence
        ending with L{CSFinalByte.CUU} to its transport.
        rX�1N)r�ZcursorUprYrgr�rIr8r:r�rrr�
test_cursorUpYs�z'ServerProtocolOutputTests.test_cursorUpcCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.cursorDown} writes the control sequence
        ending with L{CSFinalByte.CUD} to its transport.
        rXr�N)r�Z
cursorDownrYrgr�rIr8r;r�rrr�test_cursorDowncs�z)ServerProtocolOutputTests.test_cursorDowncCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.cursorForward} writes the control sequence
        ending with L{CSFinalByte.CUF} to its transport.
        rXr�N)r�Z
cursorForwardrYrgr�rIr8r<r�rrr�test_cursorForwardms�z,ServerProtocolOutputTests.test_cursorForwardcCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.cursorBackward} writes the control sequence
        ending with L{CSFinalByte.CUB} to its transport.
        rXr�N)r�r�rYrgr�rIr8r=r�rrr�test_cursorBackwardws�z-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)r�ZcursorPositionrYrgr�rIr8r>r�rrr�test_cursorPosition�s�z-ServerProtocolOutputTests.test_cursorPositioncCs*|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)r�Z
cursorHomerYrgr�rIr8r>r�rrr�test_cursorHome�s
�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)r�r�rYrgr��ESCr+r�rrr�
test_index�s
�z$ServerProtocolOutputTests.test_indexcCs*|j��|�|j��|jtjj�dS)zt
        L{ServerProtocol.reverseIndex} writes the control sequence
        ending in the L{C1SevenBit.RI}.
        N)r�r�rYrgr�r�rGrJr�rrr�test_reverseIndex�s
�z+ServerProtocolOutputTests.test_reverseIndexcCs |j��|�|j��d�dS)zM
        L{ServerProtocol.nextLine} writes C{"
"} to its transport.
        s
N)r�r�rYrgr�r�rrr�
test_nextLine�s
z'ServerProtocolOutputTests.test_nextLinec	CsLtjtjtjg}|j�|�|�|j��|j	d�
tt|��t
jj�dS)z�
        L{ServerProtocol.setModes} writes a control sequence
        containing the requested modes and ending in the
        L{CSFinalByte.SM}.
        r�N)rr�r�r�r�r�rYrgr�rIr}r�rr8r?�rOZ
modesToSetrrr�
test_setModes�s���z'ServerProtocolOutputTests.test_setModesc	CsLtjtjtjg}|j�|�|�|j��|j	d�
tt|��t
jj�dS)z�
        L{ServerProtocol.setPrivatesModes} writes a control sequence
        containing the requested private modes and ending in the
        L{CSFinalByte.SM}.
        r�N)rZERRORZCOLUMNZORIGINr�r�rYrgr�rIr}r�rr8r?)rOZprivateModesToSetrrr�test_setPrivateModes�s����z.ServerProtocolOutputTests.test_setPrivateModesc	CsLtjtjtjg}|j�|�|�|j��|j	d�
tt|��t
jj�dS)zs
        L{ServerProtocol.resetModes} writes the control sequence
        ending in the L{CSFinalByte.RM}.
        r�N)rr�r�r�r�r�rYrgr�rIr}r�rr8rCr�rrr�test_resetModes�s���z)ServerProtocolOutputTests.test_resetModescCs*|j��|�|j��|jtjj�dS)zp
        L{ServerProtocol.singleShift2} writes an escape sequence
        followed by L{C1SevenBit.SS2}
        N)r�r�rYrgr�r�rGrKr�rrr�test_singleShift2�s
�z+ServerProtocolOutputTests.test_singleShift2cCs*|j��|�|j��|jtjj�dS)zp
        L{ServerProtocol.singleShift3} writes an escape sequence
        followed by L{C1SevenBit.SS3}
        N)r�r�rYrgr�r�rGrLr�rrr�test_singleShift3�s
�z+ServerProtocolOutputTests.test_singleShift3cCsJ|j�tt�tt��|�|j��|jt	t�dt	t�t
jj�dS)z�
        L{ServerProtocol.selectGraphicRendition} writes a control
        sequence containing the requested attributes and ending with
        L{CSFinalByte.SGR}
        r�N)r�ZselectGraphicRendition�strrr
rYrgr�rIrr8rEr�rrr�test_selectGraphicRendition�s�����z5ServerProtocolOutputTests.test_selectGraphicRenditioncCs*|j��|�|j��|jtjj�dS)zz
        L{ServerProtocol.horizontalTabulationSet} writes the escape
        sequence ending in L{C1SevenBit.HTS}
        N)r�ZhorizontalTabulationSetrYrgr�r�rGrHr�rrr�test_horizontalTabulationSets
��z6ServerProtocolOutputTests.test_horizontalTabulationSetcCs*|j��|�|j��|jtjj�dS)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)r�r�rYrgr�rIr8rAr�rrr�test_eraseToLineEnds
�z-ServerProtocolOutputTests.test_eraseToLineEndcCs.|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.)
        r�N)r�r�rYrgr�rIr8rAr�rrr�test_eraseToLineBeginnings
�z3ServerProtocolOutputTests.test_eraseToLineBeginningcCs.|j��|�|j��|jdtjj�dS)z�
        L{ServerProtocol.eraseLine} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 2 (the entire line.)
        �2N)r�r�rYrgr�rIr8rAr�rrr�test_eraseLine's
�z(ServerProtocolOutputTests.test_eraseLinecCs*|j��|�|j��|jtjj�dS)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)r�r�rYrgr�rIr8r@r�rrr�test_eraseToDisplayEnd2s
�z0ServerProtocolOutputTests.test_eraseToDisplayEndcCs.|j��|�|j��|jdtjj�dS)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.)
        r�N)r�r�rYrgr�rIr8r@r�rrr�test_eraseToDisplayBeginning>s
�z6ServerProtocolOutputTests.test_eraseToDisplayBeginningcCs.|j��|�|j��|jdtjj�dS)z�
        L{ServerProtocol.eraseDisplay} writes the control sequence
        sequence ending in L{CSFinalByte.ED} a parameter of 2 (the
        entire page)
        r�N)r�r�rYrgr�rIr8r@r�rrr�test_eraseToDisplayJs
�z-ServerProtocolOutputTests.test_eraseToDisplaycCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.deleteCharacter} writes the control sequence
        containing the number of characters to delete and ending in
        L{CSFinalByte.DCH}
        r&�4N)r�r�rYrgr�rIr8r9r�rrr�test_deleteCharacterUs�z.ServerProtocolOutputTests.test_deleteCharactercCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.insertLine} writes the control sequence
        containing the number of lines to insert and ending in
        L{CSFinalByte.IL}
        rc�5N)r�r�rYrgr�rIr8rBr�rrr�test_insertLine`s�z)ServerProtocolOutputTests.test_insertLinecCs0|j�d�|�|j��|jdtjj�dS)z�
        L{ServerProtocol.deleteLine} writes the control sequence
        containing the number of lines to delete and ending in
        L{CSFinalByte.DL}
        rd�6N)r�r�rYrgr�rIr8rDr�rrr�test_deleteLineks�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�r�r�rYrgr�rIr�rrr�test_setScrollRegionNoArgsvs
z4ServerProtocolOutputTests.test_setScrollRegionNoArgscCs.|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'}.
        rX)�firsts1;r�Nr�r�rrr�test_setScrollRegionJustFirst�sz7ServerProtocolOutputTests.test_setScrollRegionJustFirstcCs.|jjdd�|�|j��|jdd�dS)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'}.
        rX)�lasts;1r�Nr�r�rrr�test_setScrollRegionJustLast�sz6ServerProtocolOutputTests.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'}.
        rXra)rrs1;2r�Nr�r�rrr� test_setScrollRegionFirstAndLast�sz:ServerProtocolOutputTests.test_setScrollRegionFirstAndLastcCs.|j��|�|j��|jdtjj�dS)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)r�r�rYrgr�rIr8rFr�rrr�test_reportCursorPosition�s
�z3ServerProtocolOutputTests.test_reportCursorPositionN)&rTrUrVr3r+r�rIr�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�rrrrrrrrrr�HsD












r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�DeprecationsTestszP
    Tests to ensure deprecation of L{insults.colors} and L{insults.client}
    cCsD|��}|�|ddt�|�|dd|�|�t|�d�dS)zJ
        Ensures that the correct deprecation warning was issued.
        r�category�messagerXN)Z
flushWarningsZassertIs�DeprecationWarningrYrZ)rOr	�warningsrrr�ensureDeprecated�sz"DeprecationsTests.ensureDeprecatedcCstd�|�d�dS)z<
        The L{insults.colors} module is deprecated
        ztwisted.conch.insults.colorszotwisted.conch.insults.colors was deprecated in Twisted 10.1.0: Please use twisted.conch.insults.helper instead.N�rrr�rrr�test_colors�szDeprecationsTests.test_colorscCstd�|�d�dS)z<
        The L{insults.client} module is deprecated
        ztwisted.conch.insults.clientzptwisted.conch.insults.client was deprecated in Twisted 10.1.0: Please use twisted.conch.insults.insults instead.Nr
r�rrr�test_client�szDeprecationsTests.test_clientN)rTrUrVr3rrrrrrrr�s

r)2Ztwisted.python.reflectrZ
twisted.trialrZtwisted.test.proto_helpersrZtwisted.conch.insults.insultsrrrrr	r
rrr
rrrrZtwisted.python.compatrrZtwisted.python.constantsrr�textwraprrr"r%�objectrMr+r7�dedentr8rGrrWrnr`ZTestCaserortrwr~r�r�rrrrr�<module>s�$
��"�� %
g