§
    Ètºf€}  ã                   óJ  — d dl Z d dlmZmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZmZ d dlmZ d	„ Zd
„ Zd„ Zd„ Z  e!¦   «         Z"d„ Z#d„ Z$ e$ddg d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d ¢g e j%        d!¦  «        ¬"¦  «        Z& e$d#ddd$gdd%gd&d'gd(d)gdd*gd+d,gd-d.gd/d0gd1d2gd3dgd4d5gd6d7gd8d9gd:d;gd<d=gd>d?gg e j%        d@¦  «        ¬"¦  «        Z' G dA„ dB¦  «        Z( G dC„ dD¦  «        Z)dEZ* G dF„ dGe)¦  «        Z+[* G dH„ dIe+ej,        ¦  «        Z- G dJ„ dKe+ej,        ¦  «        Z. G dL„ dMe+ej,        ¦  «        Z/ G dN„ dOe+ej,        ¦  «        Z0 G dP„ dQej,        e)¦  «        Z1 G dR„ dSej,        ¦  «        Z2dS )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                 óR   — t          t          | ¦  «                             |¦  «        S ©N)ÚsuperÚMockÚ__getattribute__)ÚmockÚnames     ú^/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/conch/test/test_insults.pyÚ_getattrr       s    € Ý•�tÑÔ×-Ò-¨dÑ3Ô3Ð3ó    c                 ó"   — t          | d¦  «        S )NÚoccurrences©r    ©r   s    r   r#   r#   "   s   € Ý�D˜-Ñ(Ô(Ð(r!   c                 ó"   — t          | d¦  «        S )NÚmethodsr$   r%   s    r   r'   r'   &   s   € Ý�D˜)Ñ$Ô$Ð$r!   c                 óJ   — t          | ¦  «                             |¦  «         d S r   )r#   Úappend)r   Úobjs     r   Ú_appendr+   *   s$   € Ý�ÑÔ×Ò˜SÑ!Ô!Ð!Ð!Ð!r!   c                 óH   — t          t          | dz  |z  g¦  «        ¦  «        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   Ú_ecmaCodeTableCoordinater2   1   s&   € õ" •˜V q™[¨CÑ/Ð0Ñ1Ô1Ñ2Ô2Ð2r!   c                 ór   ‡— ˆfd„t          |¦  «        D ¦   «         }||d<   t          | t          f|¦  «        S )Nc           
      ó†   •— i | ]=\  }}t          |¦  «        D ](\  }}|¯|t          t          |‰z   |¦  «        ¦  «        “Œ)Œ>S © )Ú	enumerater   r2   )Ú.0Újr1   Úir   Ú	colOffsets        €r   ú
<dictcomp>z/_makeControlFunctionSymbols.<locals>.<dictcomp>J   sm   ø€ ð ð ð áˆAˆsÝ  ‘~”~ðð ñ ˆAˆtØð	Ø�mÕ4°Q¸±]ÀAÑFÔFÑGÔGðð ð ð r!   Ú__doc__)r6   Útyper   )r   r:   ÚnamesÚdocÚattrss    `   r   Ú_makeControlFunctionSymbolsrA   E   sS   ø€ ð
ð ð ð å Ñ&Ô&ðñ ô €Eð €Eˆ)ÑÝ�•v�i Ñ'Ô'Ð'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}
    )r:   r>   r?   Ú
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                   ó*   — e Zd ZeZdefd„Zd„ Zd„ ZdS )r   Nc                 óN   — g | _         |€i }|| _        |t          ur	|| _        dS dS )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__ž   s>   € ð
 ˆÔØˆ?ØˆGØˆŒØ¥'Ð)Ð)Ø#2ˆDÔ Ð Ð ð *Ð)r!   c                 ó|   — t          | d¦  «        }|t          u rt          ¦   «         }t          | d|||f¦  «         |S )Nr’   Ú__call__)r    r‘   r   r+   )r“   ÚaÚkwÚreturnValues       r   r–   zMock.__call__ª   sE   € Ý˜tÐ%6Ñ7Ô7ˆØ�'Ð!Ð!Ý™&œ&ˆKå��z ;°°2Ð6Ñ7Ô7Ð7ØÐr!   c                 óœ   — t          | d¦  «        }||v rt          ||         ¬¦  «        }nt          ¦   «         }t          | ||f¦  «         |S )Nr'   )r’   )r    r   r+   )r“   r   r'   Ú	attrValues       r   r   zMock.__getattribute__²   sT   € Ý˜4 Ñ+Ô+ˆØ�7ˆ?ˆ?Ý¨W°T¬]Ð;Ñ;Ô;ˆIˆIå™œˆIå��t˜YÐ'Ñ(Ô(Ð(ØÐr!   )Ú__name__Ú
__module__Ú__qualname__r‘   r’   r”   r–   r   r5   r!   r   r   r   ›   sP   € € € € € Ø€Oà#°Wð 
3ð 
3ð 
3ð 
3ðð ð ðð ð ð ð r!   r   c                   ó   — e Zd Zdi fd„ZdS )Ú	MockMixinr5   c                 óL  — |\  }}|                       ||¦  «         |                       t          t          |¦  «        ¦  «        d¦  «         t          |¦  «        \  \  }}}	}
|                       |d¦  «         |                       |	|¦  «         |                       |
|¦  «         |S )Né   r–   )ÚassertEqualÚlenr#   )r“   Ú
occurrenceÚ
methodNameÚexpectedPositionalArgsÚexpectedKeywordArgsÚattrr   ÚcallÚresultÚargsr˜   s              r   Ú
assertCallzMockMixin.assertCall¾   s«   € ð  ‰
ˆˆdØ×Ò˜˜zÑ*Ô*Ð*Ø×Ò��[¨Ñ.Ô.Ñ/Ô/°Ñ3Ô3Ð3Ý%0°Ñ%6Ô%6Ñ"Ñ	!ˆ$�˜˜bØ×Ò˜˜zÑ*Ô*Ð*Ø×Ò˜Ð5Ñ6Ô6Ð6Ø×Ò˜Ð0Ñ1Ô1Ð1Øˆr!   N)rœ   r�   rž   r­   r5   r!   r   r    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                   ór   — e Zd ZU dZeee                  ed<   dD ]\  ZZ	 e
eee	dœz  ¦  «         Œ[[	d„ ZdS )ÚByteGroupingsMixinNÚprotocolFactory))ÚPairsé   )ÚTriplesé   )ÚQuadsr-   )ÚQuintsé   )ÚSexesé   )Ú	groupNameÚbytesPerc                 ó¼   — |                       t          |¦  «                             d¦  «        d|f¦  «        }|                      t          |¦  «        g ¦  «         d S )Nr   ÚmakeConnection)r­   r#   Úpopr£   )r“   Ú	transportÚprotoÚparserr«   s        r   ÚverifyResultsz ByteGroupingsMixin.verifyResultsê   sT   € Ø—’¥¨UÑ!3Ô!3×!7Ò!7¸Ñ!:Ô!:Ð<LÈvÈiÑXÔXˆØ×Ò� VÑ,Ô,¨bÑ1Ô1Ð1Ð1Ð1r!   )rœ   r�   rž   r°   r   r   r   Ú__annotations__ÚwordÚnÚexecÚ_byteGroupingTestTemplaterÂ   r5   r!   r   r¯   r¯   Ý   s}   € € € € € € Ø04€O�X˜d 8œnÔ-Ð4Ð4Ñ4ðð Mð M‰ˆˆað 	ˆÐ&°tÈÐ)KÐ)KÑKÑLÔLÐLÐLØˆað2ð 2ð 2ð 2ð 2r!   r¯   c                   ó   — e Zd ZeZdZd„ ZdS )ÚServerArrowKeysTestss   [A[B[C[Dc                 óv  — t                                | |||¦  «         |j        |j        |j        |j        fD ]^}|                      t          |¦  «                             d¦  «        d|d f¦  «        }|  	                    t          |¦  «        g ¦  «         Œ_|  
                    t          |¦  «        ¦  «         d S )Nr   ÚkeystrokeReceived)r¯   rÂ   ÚUP_ARROWÚ
DOWN_ARROWÚRIGHT_ARROWÚ
LEFT_ARROWr­   r#   r¾   r£   ÚassertFalse)r“   r¿   rÀ   rÁ   Úarrowr«   s         r   rÂ   z"ServerArrowKeysTests.verifyResultsø   sÂ   € Ý×(Ò(¨¨y¸%ÀÑHÔHÐHð ŒOØÔØÔØÔð	
ð 		6ð 		6ˆEð —_’_Ý˜EÑ"Ô"×&Ò& qÑ)Ô)Ð+>ÀÈÀñô ˆFð ×Ò�[¨Ñ0Ô0°"Ñ5Ô5Ð5Ð5Ø×Ò� UÑ+Ô+Ñ,Ô,Ð,Ð,Ð,r!   N©rœ   r�   rž   r   r°   Ú
TEST_BYTESrÂ   r5   r!   r   rÉ   rÉ   ò   s/   € € € € € Ø$€Oð -€Jð-ð -ð -ð -ð -r!   rÉ   c                   ó   — e Zd ZeZdZd„ ZdS )ÚPrintableCharactersTestss   abc123ABC!@#abc123c                 óR  — t                                | |||¦  «         t          d¦  «        D ]^}|                      t	          |¦  «                             d¦  «        d|d f¦  «        }|                      t	          |¦  «        g ¦  «         Œ_t          d¦  «        D ]c}|                      t	          |¦  «                             d¦  «        d||j        f¦  «        }|                      t	          |¦  «        g ¦  «         Œdt	          |¦  «        }|                      ||›d�¦  «         d S )Ns   abc123ABC!@#r   rË   s   abc123z should have been [])	r¯   rÂ   r   r­   r#   r¾   r£   ÚALTrÐ   )r“   r¿   rÀ   rÁ   Úcharr«   Úoccss          r   rÂ   z&PrintableCharactersTests.verifyResults  s/  € Ý×(Ò(¨¨y¸%ÀÑHÔHÐHå˜oÑ.Ô.ð 	6ð 	6ˆDØ—_’_Ý˜EÑ"Ô"×&Ò& qÑ)Ô)Ð+>ÀÀtÀñô ˆFð ×Ò�[¨Ñ0Ô0°"Ñ5Ô5Ð5Ð5å˜iÑ(Ô(ð 	6ð 	6ˆDØ—_’_Ý˜EÑ"Ô"×&Ò& qÑ)Ô)Ð+>ÀÀvÄzÐ@Rñô ˆFð ×Ò�[¨Ñ0Ô0°"Ñ5Ô5Ð5Ð5å˜5Ñ!Ô!ˆØ×Ò˜ $Ð>Ð>Ð>Ñ?Ô?Ð?Ð?Ð?r!   NrÒ   r5   r!   r   rÕ   rÕ     s4   € € € € € Ø$€Oð
 ?€Jð@ð @ð @ð @ð @r!   rÕ   c                   óˆ   — e Zd ZdZeZg ZdD ]Ze                     dez   ¦  «         Œd 	                    e¦  «        Z
[[d„ ZdS )ÚServerFunctionKeysTestsz9Test for parsing and dispatching function keys (F1 - F12))s   OPs   OQs   ORs   OSs   15~s   17~s   18~s   19~s   20~s   21~s   23~s   24~ó   [r!   c                 óŠ  — t                                | |||¦  «         t          dd¦  «        D ]r}t          |d|fz  ¦  «        }|                      t          |¦  «                             d¦  «        d|d f¦  «        }|                      t          |¦  «        g ¦  «         Œs|                      t          |¦  «        ¦  «         d S )Nr¢   é   zF%dr   rË   )	r¯   rÂ   ÚrangeÚgetattrr­   r#   r¾   r£   rÐ   )r“   r¿   rÀ   rÁ   ÚfuncNumÚfuncArgr«   s          r   rÂ   z%ServerFunctionKeysTests.verifyResults;  sÃ   € Ý×(Ò(¨¨y¸%ÀÑHÔHÐHÝ˜Q ‘|”|ð 	6ð 	6ˆGÝ˜f e¨w¨jÑ&8Ñ9Ô9ˆGØ—_’_Ý˜EÑ"Ô"×&Ò& qÑ)Ô)Ð+>ÀÈ$Àñô ˆFð ×Ò�[¨Ñ0Ô0°"Ñ5Ô5Ð5Ð5Ø×Ò� UÑ+Ô+Ñ,Ô,Ð,Ð,Ð,r!   N)rœ   r�   rž   r<   r   r°   ÚbyteListÚ	byteCodesr)   ÚjoinrÓ   rÂ   r5   r!   r   rÛ   rÛ   #  sv   € € € € € ØCÐCà$€Oà€Hðð .ð .ˆ	ð 	�Š˜ 9Ñ,Ñ-Ô-Ð-Ð-Ø—’˜(Ñ#Ô#€JØ�)ð-ð -ð -ð -ð -r!   rÛ   c                   óR   — e Zd ZeZdZdZdZdZeez   ez   ez   ez   ez   Z	[[[[d„ Z
dS )ÚClientCursorMovementTestss   [2Bs   [4Cs   [As   [2Dc                 óP  — t                                | |||¦  «         dD ]c\  }}|                      t          |¦  «                             d¦  «        d|z   |f¦  «        }|                      t          |¦  «        g ¦  «         Œd|                      t          |¦  «        ¦  «         d S )N))ÚDownr²   )ÚForwardr-   ©ÚUpr¢   ©ÚBackwardr²   rë   rí   r   Úcursor)r¯   rÂ   r­   r#   r¾   r£   rÐ   )r“   r¿   rÀ   rÁ   ÚmethodÚcountr«   s          r   rÂ   z'ClientCursorMovementTests.verifyResultsQ  s¯   € Ý×(Ò(¨¨y¸%ÀÑHÔHÐHð
ð 	6ð 	6‰MˆF�Eð —_’_Ý˜EÑ"Ô"×&Ò& qÑ)Ô)¨8°fÑ+<¸u¸hñô ˆFð ×Ò�[¨Ñ0Ô0°"Ñ5Ô5Ð5Ð5Ø×Ò� UÑ+Ô+Ñ,Ô,Ð,Ð,Ð,r!   N)rœ   r�   rž   r   r°   Úd2Úr4Úu1Úl2rÓ   rÂ   r5   r!   r   rç   rç   F  sa   € € € € € Ø$€Oà	€BØ	€BØ	€BØ	€Bà�b‘˜2‘ Ñ" RÑ'¨"Ñ,€JØ
ˆB��Bð-ð -ð -ð -ð -r!   rç   c                   ó’   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚClientControlSequencesTestsc                 ó   ‡ — t          ¦   «         ‰ _        t          ¦   «         ‰ _        t	          ˆ fd„¦  «        ‰ _        ‰ ‰ j        _        ‰ j                             ‰ j        ¦  «         ‰                      t          ‰ j        ¦  «         
                    d¦  «        d‰ j        f¦  «        }‰                      t          |¦  «        ¦  «         d S )Nc                  ó   •— ‰ j         S r   )rÀ   ©r“   s   €r   ú<lambda>z3ClientControlSequencesTests.setUp.<locals>.<lambda>g  s	   ø€ ¨T¬Z€ r!   r   r½   )r   r¿   r   rÀ   r   rÁ   Úfactoryr½   r­   r#   r¾   rÐ   )r“   r«   s   ` r   ÚsetUpz!ClientControlSequencesTests.setUpd  s±   ø€ Ý(Ñ*Ô*ˆŒÝ‘V”VˆŒ
Ý$Ð%7Ð%7Ð%7Ð%7Ñ8Ô8ˆŒØ"ˆŒÔØŒ×"Ò" 4¤>Ñ2Ô2Ð2Ø—’Ý˜œ
Ñ#Ô#×'Ò'¨Ñ*Ô*Ð,<¸t¼{¸nñ
ô 
ˆð 	×Ò� VÑ,Ô,Ñ-Ô-Ð-Ð-Ð-r!   c                 ó”  — | j                              d                     d„ t          d¦  «        D ¦   «         ¦  «        ¦  «         t	          | j        ¦  «        }dD ]W}dD ]R}|                      |                     d¦  «        d|z   |f¦  «        }|                      t	          |¦  «        ¦  «         ŒSŒX|                      |¦  «         d S )Nr!   c              3   ó0   K  — | ]}d D ]}d|z   |z   V — ŒŒdS ))r!   ó   2s   20s   200rÜ   Nr5   )r7   ÚchrÅ   s      r   ú	<genexpr>zBClientControlSequencesTests.testSimpleCardinals.<locals>.<genexpr>q  sV   è è € ð ð àØ3ðð ð ð ˜1‘˜rÑ!ðð ð ð ð ð ð r!   s   BACD)ré   rì   rê   rî   )r¢   r²   é   éÈ   r   rï   )	rÁ   ÚdataReceivedrå   r   r#   rÀ   r­   r¾   rÐ   )r“   rÙ   Úmethrñ   r«   s        r   ÚtestSimpleCardinalsz/ClientControlSequencesTests.testSimpleCardinalso  så   € ØŒ× Ò Ø�HŠHð ð å# GÑ,Ô,ðñ ô ñ ô ñ	
ô 	
ð 	
õ ˜4œ:Ñ&Ô&ˆà9ð 	6ð 	6ˆDØ(ð 6ð 6�ØŸš¨¯ª°!©¬°hÀ±oÈÀxÑPÔP�Ø× Ò ¥¨VÑ!4Ô!4Ñ5Ô5Ð5Ð5ð6ð 	×Ò˜ÑÔÐÐÐr!   c                 ó¼  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        dd¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        dd¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns
   [5;22r[rr   ÚsetScrollRegion)r·   é   )NN©rÁ   r  r#   rÀ   r­   r¾   rÐ   ©r“   rÙ   r«   s      r   ÚtestScrollRegionz,ClientControlSequencesTests.testScrollRegion  sº   € ØŒ× Ò Ð!4Ñ5Ô5Ð5Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤Ð.?ÀÑIÔIˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤Ð.?ÀÑNÔNˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 óè  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        dd¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        dd¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   #3#4#5#6r   ÚdoubleHeightLine)T)FÚsingleWidthLineÚdoubleWidthLiner  r  s      r   ÚtestHeightAndWidthz.ClientControlSequencesTests.testHeightAndWidthŠ  s.  € ØŒ× Ò Ð!<Ñ=Ô=Ð=Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤Ð.@À'ÑJÔJˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤Ð.@À(ÑKÔKˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤Ð.?Ñ@Ô@ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤Ð.?Ñ@Ô@ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 óä  — | j                              d                     d„ t          d¦  «        D ¦   «         ¦  «        ¦  «         t	          | j        ¦  «        }t          t          fD ]s}t          t          t          t          t          fD ]P}|                      |                     d¦  «        d||f¦  «        }|                      t	          |¦  «        ¦  «         ŒQŒt|                      |¦  «         d S )Nr!   c                 ól   ‡— g | ]0Šd                       ˆfd„t          d¦  «        D ¦   «         ¦  «        ‘Œ1S )r!   c                 ó    •— g | ]
}d ‰z   |z   ‘ŒS )ó   r5   )r7   rÅ   Úgs     €r   ú
<listcomp>zKClientControlSequencesTests.testCharacterSet.<locals>.<listcomp>.<listcomp>Ÿ  s!   ø€ ÐKÐKÐK°!˜g¨™k¨A™oÐKÐKÐKr!   s   AB012)rå   r   )r7   r  s    @r   r  z@ClientControlSequencesTests.testCharacterSet.<locals>.<listcomp>ž  sR   ø€ ð ð ð àð —H’HÐKÐKÐKÐKµyÀÑ7JÔ7JÐKÑKÔKÑLÔLðð ð r!   s   ()r   ÚselectCharacterSet)rÁ   r  rå   r   r#   rÀ   r   r   r	   r
   r   r   r   r­   r¾   rÐ   )r“   rÙ   ÚwhichÚcharsetr«   s        r   ÚtestCharacterSetz,ClientControlSequencesTests.testCharacterSet›  s  € ØŒ× Ò Ø�HŠHðð å& uÑ-Ô-ðñ ô ñô ñ	
ô 	
ð 	
õ ˜4œ:Ñ&Ô&ˆå�"�Xð 	6ð 	6ˆEåÝÝÝÝ$ðð 
6ð 
6�ð ŸšØ—H’H˜Q‘K”KÐ!5¸ÀÐ7Gñô �ð × Ò ¥¨VÑ!4Ô!4Ñ5Ô5Ð5Ð5ð
6ð 	×Ò˜ÑÔÐÐÐr!   c                 ó¸  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   r   ÚshiftInÚshiftOutr  r  s      r   ÚtestShiftingz(ClientControlSequencesTests.testShifting´  s³   € ØŒ× Ò  Ñ-Ô-Ð-Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤¨iÑ8Ô8ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤¨jÑ9Ô9ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 ó¸  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   NOr   ÚsingleShift2ÚsingleShift3r  r  s      r   ÚtestSingleShiftsz,ClientControlSequencesTests.testSingleShifts¿  s³   € ØŒ× Ò  Ñ/Ô/Ð/Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤¨nÑ=Ô=ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤¨nÑ=Ô=ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 ó¸  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   =>r   ÚapplicationKeypadModeÚnumericKeypadModer  r  s      r   ÚtestKeypadModez*ClientControlSequencesTests.testKeypadModeÊ  sµ   € ØŒ× Ò  Ñ/Ô/Ð/Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤Ð.EÑFÔFˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤Ð.AÑBÔBˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 ó¸  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   78r   Ú
saveCursorÚrestoreCursorr  r  s      r   Ú
testCursorz&ClientControlSequencesTests.testCursorÕ  s³   € ØŒ× Ò  Ñ/Ô/Ð/Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤¨lÑ;Ô;ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤¨oÑ>Ô>ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 ó"  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   cr   Úresetr  r  s      r   Ú	testResetz%ClientControlSequencesTests.testResetà  sz   € ØŒ× Ò  Ñ*Ô*Ð*Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤¨gÑ6Ô6ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 óN  — | j                              d¦  «         t          | j        ¦  «        }|                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |                     d¦  «        d¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   DMEr   ÚindexÚreverseIndexÚnextLiner  r  s      r   Ú	testIndexz%ClientControlSequencesTests.testIndexè  sí   € ØŒ× Ò Ð!3Ñ4Ô4Ð4Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤¨gÑ6Ô6ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤¨nÑ=Ô=ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’ §¢¨!¡¤¨jÑ9Ô9ˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c           	      óˆ  — | j                              dd                     d„ t          j        t          j        t          j        fD ¦   «         ¦  «        z   dz   ¦  «         | j                              dd                     d„ t          j        t          j        t          j        fD ¦   «         ¦  «        z   dz   ¦  «         t          | j        ¦  «        }|  	                    | 
                    d¦  «        dt          j        t          j        t          j        gf¦  «        }|                      t          |¦  «        ¦  «         |  	                    | 
                    d¦  «        d	t          j        t          j        t          j        gf¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )
NrÜ   ó   ;c              3   ó"   K  — | ]
}d |fz  V — ŒdS ©s   %dNr5   ©r7   Úms     r   r  z8ClientControlSequencesTests.testModes.<locals>.<genexpr>ù  ó(   è è € ÐPÐP¨˜  ™ÐPÐPÐPÐPÐPÐPr!   ó   hc              3   ó"   K  — | ]
}d |fz  V — ŒdS r8  r5   r9  s     r   r  z8ClientControlSequencesTests.testModes.<locals>.<genexpr>þ  r;  r!   ó   lr   ÚsetModesÚ
resetModes)rÁ   r  rå   r   ÚKAMÚIRMÚLNMr#   rÀ   r­   r¾   rÐ   r  s      r   Ú	testModesz%ClientControlSequencesTests.testModesö  s  € ØŒ× Ò ØØ�iŠiÐPÐP­u¬y½%¼)ÅUÄYÐ.OÐPÑPÔPÑPÔPñQàññ	
ô 	
ð 	
ð
 	Œ× Ò ØØ�iŠiÐPÐP­u¬y½%¼)ÅUÄYÐ.OÐPÑPÔPÑPÔPñQàññ	
ô 	
ð 	
õ
 ˜4œ:Ñ&Ô&ˆà—’Ø�HŠH�Q‰KŒK˜¥u¤yµ%´)½U¼YÐ&GÐ%Iñ
ô 
ˆð 	×Ò� VÑ,Ô,Ñ-Ô-Ð-à—’Ø�HŠH�Q‰KŒK˜­¬µE´I½u¼yÐ(IÐ'Kñ
ô 
ˆð 	×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 óÄ  — | j                              d¦  «         t          | j        ¦  «        }dD ]M}|                      |                     d¦  «        |¦  «        }|                      t          |¦  «        ¦  «         ŒN|                      |                     d¦  «        dd¦  «        }|                      t          |¦  «        ¦  «         |                      |¦  «         d S )Ns   [K[1K[2K[J[1J[2J[3P)ÚeraseToLineEndÚeraseToLineBeginningÚ	eraseLineÚeraseToDisplayEndÚeraseToDisplayBeginningÚeraseDisplayr   ÚdeleteCharacter)r´   r  )r“   rÙ   r  r«   s       r   ÚtestErasurez'ClientControlSequencesTests.testErasure  sÍ   € ØŒ× Ò Ð!SÑTÔTÐTÝ˜4œ:Ñ&Ô&ˆð
ð 		2ð 		2ˆDð —_’_ T§X¢X¨a¡[¤[°$Ñ7Ô7ˆFØ×Ò�[¨Ñ0Ô0Ñ1Ô1Ð1Ð1à—’ §¢¨!¡¤Ð.?ÀÑFÔFˆØ×Ò� VÑ,Ô,Ñ-Ô-Ð-Ø×Ò˜ÑÔÐÐÐr!   c                 ó0  — | j                              d¦  «         t          | j        ¦  «        }dD ]O}|                      |                     d¦  «        d|f¦  «        }|                      t          |¦  «        ¦  «         ŒP|                      |¦  «         d S )Ns   [M[3M©r¢   r´   r   Ú
deleteLiner  ©r“   rÙ   Úargr«   s       r   ÚtestLineDeletionz,ClientControlSequencesTests.testLineDeletion!  ó‘   € ØŒ× Ò Ð!1Ñ2Ô2Ð2Ý˜4œ:Ñ&Ô&ˆàð 	2ð 	2ˆCØ—_’_ T§X¢X¨a¡[¤[°,ÀÀÑGÔGˆFØ×Ò�[¨Ñ0Ô0Ñ1Ô1Ð1Ð1Ø×Ò˜ÑÔÐÐÐr!   c                 ó0  — | j                              d¦  «         t          | j        ¦  «        }dD ]O}|                      |                     d¦  «        d|f¦  «        }|                      t          |¦  «        ¦  «         ŒP|                      |¦  «         d S )Ns   [L[3LrO  r   Ú
insertLiner  rQ  s       r   ÚtestLineInsertionz-ClientControlSequencesTests.testLineInsertion*  rT  r!   c                 óh  — dt          | j        ¦  «        d<   | j                             d¦  «         |                      | j                             ¦   «         d¦  «         t          | j        ¦  «        }|                      | 	                    d¦  «        d¦  «        }|                      |d¦  «         d S )N)r¹   é   ÚreportCursorPositions   [6ns   [7;8Rr   )
r'   rÀ   rÁ   r  r£   r¿   Úvaluer#   r­   r¾   r  s      r   ÚtestCursorPositionz.ClientControlSequencesTests.testCursorPosition3  sœ   € Ø6<��”
ÑÔÐ2Ñ3ØŒ× Ò  Ñ,Ô,Ð,Ø×Ò˜œ×-Ò-Ñ/Ô/°Ñ>Ô>Ð>Ý˜4œ:Ñ&Ô&ˆà—’ §¢¨!¡¤Ð.DÑEÔEˆð 	×Ò˜ Ñ(Ô(Ð(Ð(Ð(r!   c                 ó>  — t          | j        ¦  «        }| j                             d¦  «         |                      |                     d¦  «        dd¦  «         | j                             d¦  «         |                      |                     d¦  «        dd¦  «         dS )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)r#   rÀ   rÁ   r  r­   r¾   )r“   rÙ   s     r   Útest_applicationDataBytesz5ClientControlSequencesTests.test_applicationDataBytes>  s…   € õ ˜4œ:Ñ&Ô&ˆØŒ× Ò  Ñ&Ô&Ð&Ø�Š˜Ÿš ™œ W¨gÑ6Ô6Ð6ØŒ× Ò  Ñ'Ô'Ð'Ø�Š˜Ÿš ™œ W¨hÑ7Ô7Ð7Ð7Ð7r!   c                 ó  — t          | j        ¦  «        }| j                             |¦  «         |r6 | j        |                     d¦  «        g|                     d¦  «        ¢R Ž  |°6|                      |d|›�¦  «         d S )Nr   zNo other calls should happen: )r#   rÀ   rÁ   r  r­   r¾   rÐ   )r“   ÚdataÚcallsrÙ   s       r   Ú_applicationDataTestz0ClientControlSequencesTests._applicationDataTestJ  sŒ   € Ý˜4œ:Ñ&Ô&ˆØŒ× Ò  Ñ&Ô&Ð&Øð 	8ØˆDŒO˜DŸHšH Q™KœKÐ7¨%¯)ª)°A©,¬,Ð7Ð7Ð7Ð7ð ð 	8à×Ò˜ÐHÀÐHÐHÑIÔIÐIÐIÐIr!   c                 ó6   — |                       dddg¦  «         dS )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.
        s   ab©r_  )s   ab)r  N©re  rú   s    r   Ú test_shiftInAfterApplicationDataz<ClientControlSequencesTests.test_shiftInAfterApplicationDataQ  s&   € ð
 	×!Ò! )Ð.AÀ<Ð-PÑQÔQÐQÐQÐQr!   c                 ó6   — |                       dddg¦  «         dS )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.
        s   abrg  )r  Nrh  rú   s    r   Ú!test_shiftOutAfterApplicationDataz=ClientControlSequencesTests.test_shiftOutAfterApplicationDataX  s&   € ð
 	×!Ò! )Ð.AÀ=Ð-QÑRÔRÐRÐRÐRr!   c                 ó6   — |                       dddg¦  «         dS )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.
        s   abrg  )ÚcursorBackwardNrh  rú   s    r   Ú'test_cursorBackwardAfterApplicationDatazCClientControlSequencesTests.test_cursorBackwardAfterApplicationData_  s'   € ð 	×!Ò! )Ð.AÐCVÐ-WÑXÔXÐXÐXÐXr!   c                 ón   — |                       dddg¦  «         |                       ddddgffg¦  «         dS )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.
        s   abDrg  )r1  s   ab[4hr?  r-   Nrh  rú   s    r   Útest_escapeAfterApplicationDataz;ClientControlSequencesTests.test_escapeAfterApplicationDatag  sX   € ð 	×!Ò! *Ð/BÀJÐ.OÑPÔPÐPð 	×!Ò!ØÐ.°¸q¸c¸VÐ0DÐEñ	
ô 	
ð 	
ð 	
ð 	
r!   N)rœ   r�   rž   rý   r  r  r  r  r   r$  r(  r,  r/  r4  rD  rM  rS  rW  r\  ra  re  ri  rk  rn  rp  r5   r!   r   r÷   r÷   c  sj  € € € € € ð	.ð 	.ð 	.ðð ð ð 	ð 	ð 	ðð ð ð"ð ð ð2	ð 	ð 	ð	ð 	ð 	ð	ð 	ð 	ð	ð 	ð 	ðð ð ðð ð ðð ð ð0ð ð ð&ð ð ðð ð ð	)ð 	)ð 	)ð
8ð 
8ð 
8ðJð Jð JðRð Rð RðSð Sð SðYð Yð Yð
ð 
ð 
ð 
ð 
r!   r÷   c                   ó  — e Zd ZdZ edd¦  «        Ze edd¦  «        z   Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d „ Z"d!„ Z#d"„ Z$d#„ Z%d$S )%ÚServerProtocolOutputTestszh
    Tests for the bytes L{ServerProtocol} writes to its transport when its
    methods are called.
    r¢   é   r·   c                 ó�   — t          ¦   «         | _        t          ¦   «         | _        | j                             | j        ¦  «         d S r   )r   Úprotocolr   r¿   r½   rú   s    r   rý   zServerProtocolOutputTests.setUp…  s:   € Ý&Ñ(Ô(ˆŒÝ(Ñ*Ô*ˆŒØŒ×$Ò$ T¤^Ñ4Ô4Ð4Ð4Ð4r!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z�
        L{ServerProtocol.cursorUp} writes the control sequence
        ending with L{CSFinalByte.CUU} to its transport.
        r¢   ó   1N)ru  ÚcursorUpr£   r¿   r[  r†   rB   rF   rú   s    r   Útest_cursorUpz'ServerProtocolOutputTests.test_cursorUpŠ  s_   € ð
 	Œ×Ò˜qÑ!Ô!Ð!Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨t¡Oµk´oÔ6KÑ$Kñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )zƒ
        L{ServerProtocol.cursorDown} writes the control sequence
        ending with L{CSFinalByte.CUD} to its transport.
        r¢   rw  N)ru  Ú
cursorDownr£   r¿   r[  r†   rB   rI   rú   s    r   Útest_cursorDownz)ServerProtocolOutputTests.test_cursorDown”  s_   € ð
 	Œ× Ò  Ñ#Ô#Ð#Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨t¡Oµk´oÔ6KÑ$Kñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z†
        L{ServerProtocol.cursorForward} writes the control sequence
        ending with L{CSFinalByte.CUF} to its transport.
        r¢   rw  N)ru  ÚcursorForwardr£   r¿   r[  r†   rB   rL   rú   s    r   Útest_cursorForwardz,ServerProtocolOutputTests.test_cursorForwardž  s_   € ð
 	Œ×#Ò# AÑ&Ô&Ð&Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨t¡Oµk´oÔ6KÑ$Kñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z‡
        L{ServerProtocol.cursorBackward} writes the control sequence
        ending with L{CSFinalByte.CUB} to its transport.
        r¢   rw  N)ru  rm  r£   r¿   r[  r†   rB   rO   rú   s    r   Útest_cursorBackwardz-ServerProtocolOutputTests.test_cursorBackward¨  s_   € ð
 	Œ×$Ò$ QÑ'Ô'Ð'Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨t¡Oµk´oÔ6KÑ$Kñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÊ   — | j                              dd¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )zµ
        L{ServerProtocol.cursorPosition} writes a control sequence
        ending with L{CSFinalByte.CUP} and containing the expected
        coordinates to its transport.
        r   s   1;1N)ru  ÚcursorPositionr£   r¿   r[  r†   rB   r[   rú   s    r   Útest_cursorPositionz-ServerProtocolOutputTests.test_cursorPosition²  sb   € ð 	Œ×$Ò$ Q¨Ñ*Ô*Ð*Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨vÑ$5½¼Ô8MÑ$Mñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )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)ru  Ú
cursorHomer£   r¿   r[  r†   rB   r[   rú   s    r   Útest_cursorHomez)ServerProtocolOutputTests.test_cursorHome½  sN   € ð 	Œ× Ò Ñ"Ô"Ð"Ø×Ò˜œ×-Ò-Ñ/Ô/°´½K¼OÔ<QÑ1QÑRÔRÐRÐRÐRr!   c                 ó¾   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          dd¦  «        z   ¦  «         dS )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)ru  r1  r£   r¿   r[  ÚESCr2   rú   s    r   Ú
test_indexz$ServerProtocolOutputTests.test_indexÆ  s_   € ð 	Œ×ÒÑÔÐØ×ÒØŒN× Ò Ñ"Ô" D¤HÕ/GÈÈ1Ñ/MÔ/MÑ$Mñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )zt
        L{ServerProtocol.reverseIndex} writes the control sequence
        ending in the L{C1SevenBit.RI}.
        N)ru  r2  r£   r¿   r[  r‰  rr   r‰   rú   s    r   Útest_reverseIndexz+ServerProtocolOutputTests.test_reverseIndexÒ  sN   € ð
 	Œ×"Ò"Ñ$Ô$Ð$Ø×Ò˜œ×-Ò-Ñ/Ô/°´½J¼MÔ<OÑ1OÑPÔPÐPÐPÐPr!   c                 ó’   — | j                              ¦   «          |                      | j                             ¦   «         d¦  «         dS )zM
        L{ServerProtocol.nextLine} writes C{"
"} to its transport.
        s   
N)ru  r3  r£   r¿   r[  rú   s    r   Útest_nextLinez'ServerProtocolOutputTests.test_nextLineÚ  sB   € ð 	Œ×ÒÑ Ô Ð Ø×Ò˜œ×-Ò-Ñ/Ô/°Ñ9Ô9Ð9Ð9Ð9r!   c                 óH  — t           j        t           j        t           j        g}| j                             |¦  «         |                      | j                             ¦   «         | j	        d 
                    d„ |D ¦   «         ¦  «        z   t          j        j        z   ¦  «         dS )zš
        L{ServerProtocol.setModes} writes a control sequence
        containing the requested modes and ending in the
        L{CSFinalByte.SM}.
        r6  c              3   ó"   K  — | ]
}d |fz  V — ŒdS r8  r5   r9  s     r   r  z:ServerProtocolOutputTests.test_setModes.<locals>.<genexpr>ï  ó(   è è € Ð9Ð9¨˜  ™Ð9Ð9Ð9Ð9Ð9Ð9r!   N)r   rA  rB  rC  ru  r?  r£   r¿   r[  r†   rå   rB   r]   ©r“   Ú
modesToSets     r   Útest_setModesz'ServerProtocolOutputTests.test_setModesä  s”   € õ ”i¥¤­E¬IÐ6ˆ
ØŒ×Ò˜zÑ*Ô*Ð*Ø×ÒØŒN× Ò Ñ"Ô"ØŒHØ�iŠiÐ9Ð9¨jÐ9Ñ9Ô9Ñ9Ô9ñ:åŒnÔ"ñ#ñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óH  — t           j        t           j        t           j        g}| j                             |¦  «         |                      | j                             ¦   «         | j	        d 
                    d„ |D ¦   «         ¦  «        z   t          j        j        z   ¦  «         dS )zª
        L{ServerProtocol.setPrivatesModes} writes a control sequence
        containing the requested private modes and ending in the
        L{CSFinalByte.SM}.
        r6  c              3   ó"   K  — | ]
}d |fz  V — ŒdS r8  r5   r9  s     r   r  zAServerProtocolOutputTests.test_setPrivateModes.<locals>.<genexpr>  s(   è è € Ð@Ð@¨˜  ™Ð@Ð@Ð@Ð@Ð@Ð@r!   N)r   ÚERRORÚCOLUMNÚORIGINru  r?  r£   r¿   r[  r†   rå   rB   r]   )r“   ÚprivateModesToSets     r   Útest_setPrivateModesz.ServerProtocolOutputTests.test_setPrivateModesó  s¡   € õ ÔÝÔÝÔð
Ðð
 	Œ×ÒÐ0Ñ1Ô1Ð1Ø×ÒØŒN× Ò Ñ"Ô"ØŒHØ�iŠiÐ@Ð@Ð.?Ð@Ñ@Ô@Ñ@Ô@ñAåŒnÔ"ñ#ñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óH  — t           j        t           j        t           j        g}| j                             |¦  «         |                      | j                             ¦   «         | j	        d 
                    d„ |D ¦   «         ¦  «        z   t          j        j        z   ¦  «         dS )zs
        L{ServerProtocol.resetModes} writes the control sequence
        ending in the L{CSFinalByte.RM}.
        r6  c              3   ó"   K  — | ]
}d |fz  V — ŒdS r8  r5   r9  s     r   r  z<ServerProtocolOutputTests.test_resetModes.<locals>.<genexpr>  r‘  r!   N)r   rA  rB  rC  ru  r@  r£   r¿   r[  r†   rå   rB   ri   r’  s     r   Útest_resetModesz)ServerProtocolOutputTests.test_resetModes  s”   € õ
 ”i¥¤­E¬IÐ6ˆ
ØŒ× Ò  Ñ,Ô,Ð,Ø×ÒØŒN× Ò Ñ"Ô"ØŒHØ�iŠiÐ9Ð9¨jÐ9Ñ9Ô9Ñ9Ô9ñ:åŒnÔ"ñ#ñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )zp
        L{ServerProtocol.singleShift2} writes an escape sequence
        followed by L{C1SevenBit.SS2}
        N)ru  r"  r£   r¿   r[  r‰  rr   r‹   rú   s    r   Útest_singleShift2z+ServerProtocolOutputTests.test_singleShift2  óN   € ð
 	Œ×"Ò"Ñ$Ô$Ð$Ø×Ò˜œ×-Ò-Ñ/Ô/°´½J¼NÔ<PÑ1PÑQÔQÐQÐQÐQr!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )zp
        L{ServerProtocol.singleShift3} writes an escape sequence
        followed by L{C1SevenBit.SS3}
        N)ru  r#  r£   r¿   r[  r‰  rr   r�   rú   s    r   Útest_singleShift3z+ServerProtocolOutputTests.test_singleShift3  r¡  r!   c                 ó0  — | j                              t          t          ¦  «        t          t          ¦  «        ¦  «         |                      | j                             ¦   «         | j        dt          t          fz  z   t          j
        j        z   ¦  «         dS )z«
        L{ServerProtocol.selectGraphicRendition} writes a control
        sequence containing the requested attributes and ending with
        L{CSFinalByte.SGR}
        s   %d;%dN)ru  ÚselectGraphicRenditionÚstrr   r   r£   r¿   r[  r†   rB   rl   rú   s    r   Útest_selectGraphicRenditionz5ServerProtocolOutputTests.test_selectGraphicRendition$  sy   € ð 	Œ×,Ò,­Sµ©Z¬Z½½Y¹¼ÑHÔHÐHØ×ÒØŒN× Ò Ñ"Ô"ØŒH�x¥5­)Ð"4Ñ4Ñ4µ{´Ô7LÑLñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )zz
        L{ServerProtocol.horizontalTabulationSet} writes the escape
        sequence ending in L{C1SevenBit.HTS}
        N)ru  ÚhorizontalTabulationSetr£   r¿   r[  r‰  rr   r€   rú   s    r   Útest_horizontalTabulationSetz6ServerProtocolOutputTests.test_horizontalTabulationSet0  sN   € ð
 	Œ×-Ò-Ñ/Ô/Ð/Ø×Ò˜œ×-Ò-Ñ/Ô/°´½J¼NÔ<PÑ1PÑQÔQÐQÐQÐQr!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )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)ru  rF  r£   r¿   r[  r†   rB   rd   rú   s    r   Útest_eraseToLineEndz-ServerProtocolOutputTests.test_eraseToLineEnd8  sN   € ð 	Œ×$Ò$Ñ&Ô&Ð&Ø×Ò˜œ×-Ò-Ñ/Ô/°´½K¼NÔ<PÑ1PÑQÔQÐQÐQÐQr!   c                 óÆ   — | j                              ¦   «          |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )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.)
        rw  N)ru  rG  r£   r¿   r[  r†   rB   rd   rú   s    r   Útest_eraseToLineBeginningz3ServerProtocolOutputTests.test_eraseToLineBeginningB  sR   € ð 	Œ×*Ò*Ñ,Ô,Ð,Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸D±Å;Ä>ÔCWÑ1WÑXÔXÐXÐXÐXr!   c                 óÆ   — | j                              ¦   «          |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z¦
        L{ServerProtocol.eraseLine} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 2 (the entire line.)
        r   N)ru  rH  r£   r¿   r[  r†   rB   rd   rú   s    r   Útest_eraseLinez(ServerProtocolOutputTests.test_eraseLineL  sR   € ð 	Œ×ÒÑ!Ô!Ð!Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸D±Å;Ä>ÔCWÑ1WÑXÔXÐXÐXÐXr!   c                 óÀ   — | j                              ¦   «          |                      | j                             ¦   «         | j        t          j        j        z   ¦  «         dS )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)ru  rI  r£   r¿   r[  r†   rB   ra   rú   s    r   Útest_eraseToDisplayEndz0ServerProtocolOutputTests.test_eraseToDisplayEndU  sN   € ð 	Œ×'Ò'Ñ)Ô)Ð)Ø×Ò˜œ×-Ò-Ñ/Ô/°´½K¼NÔ<PÑ1PÑQÔQÐQÐQÐQr!   c                 óÆ   — | j                              ¦   «          |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )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.)
        rw  N)ru  rJ  r£   r¿   r[  r†   rB   ra   rú   s    r   Útest_eraseToDisplayBeginningz6ServerProtocolOutputTests.test_eraseToDisplayBeginning_  sR   € ð 	Œ×-Ò-Ñ/Ô/Ð/Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸D±Å;Ä>ÔCWÑ1WÑXÔXÐXÐXÐXr!   c                 óÆ   — | j                              ¦   «          |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z¤
        L{ServerProtocol.eraseDisplay} writes the control sequence
        sequence ending in L{CSFinalByte.ED} a parameter of 2 (the
        entire page)
        r   N)ru  rK  r£   r¿   r[  r†   rB   ra   rú   s    r   Útest_eraseToDisplayz-ServerProtocolOutputTests.test_eraseToDisplayi  sR   € ð 	Œ×"Ò"Ñ$Ô$Ð$Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸D±Å;Ä>ÔCWÑ1WÑXÔXÐXÐXÐXr!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z®
        L{ServerProtocol.deleteCharacter} writes the control sequence
        containing the number of characters to delete and ending in
        L{CSFinalByte.DCH}
        r-   ó   4N)ru  rL  r£   r¿   r[  r†   rB   rD   rú   s    r   Útest_deleteCharacterz.ServerProtocolOutputTests.test_deleteCharacterr  s_   € ð 	Œ×%Ò% aÑ(Ô(Ð(Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨t¡Oµk´oÔ6KÑ$Kñ	
ô 	
ð 	
ð 	
ð 	
r!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z£
        L{ServerProtocol.insertLine} writes the control sequence
        containing the number of lines to insert and ending in
        L{CSFinalByte.IL}
        r·   ó   5N)ru  rV  r£   r¿   r[  r†   rB   rg   rú   s    r   Útest_insertLinez)ServerProtocolOutputTests.test_insertLine}  óT   € ð 	Œ× Ò  Ñ#Ô#Ð#Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸D±Å;Ä>ÔCWÑ1WÑXÔXÐXÐXÐXr!   c                 óÈ   — | j                              d¦  «         |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )z£
        L{ServerProtocol.deleteLine} writes the control sequence
        containing the number of lines to delete and ending in
        L{CSFinalByte.DL}
        r¹   ó   6N)ru  rP  r£   r¿   r[  r†   rB   rj   rú   s    r   Útest_deleteLinez)ServerProtocolOutputTests.test_deleteLine†  r½  r!   c                 ó¨   — | j                              ¦   «          |                      | j                             ¦   «         | j        dz   dz   ¦  «         dS )z¶
        With no arguments, L{ServerProtocol.setScrollRegion} writes a
        control sequence with no parameters, but a parameter
        separator, and ending in C{b'r'}.
        r6  ó   rN©ru  r	  r£   r¿   r[  r†   rú   s    r   Útest_setScrollRegionNoArgsz4ServerProtocolOutputTests.test_setScrollRegionNoArgs�  sM   € ð 	Œ×%Ò%Ñ'Ô'Ð'Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸D±À4Ñ1GÑHÔHÐHÐHÐHr!   c                 ó¬   — | j                              d¬¦  «         |                      | j                             ¦   «         | j        dz   dz   ¦  «         dS )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¢   )Úfirsts   1;rÂ  NrÃ  rú   s    r   Útest_setScrollRegionJustFirstz7ServerProtocolOutputTests.test_setScrollRegionJustFirst˜  sS   € ð 	Œ×%Ò%¨AÐ%Ñ.Ô.Ð.Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸EÑ1AÀDÑ1HÑIÔIÐIÐIÐIr!   c                 ó¬   — | j                              d¬¦  «         |                      | j                             ¦   «         | j        dz   dz   ¦  «         dS )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¡  sS   € ð 	Œ×%Ò%¨1Ð%Ñ-Ô-Ð-Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸EÑ1AÀDÑ1HÑIÔIÐIÐIÐIr!   c                 ó®   — | j                              dd¬¦  «         |                      | j                             ¦   «         | j        dz   dz   ¦  «         dS )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É  s   1;2rÂ  NrÃ  rú   s    r   Ú test_setScrollRegionFirstAndLastz:ServerProtocolOutputTests.test_setScrollRegionFirstAndLastª  sU   € ð 	Œ×%Ò%¨A°AÐ%Ñ6Ô6Ð6Ø×Ò˜œ×-Ò-Ñ/Ô/°´¸FÑ1BÀTÑ1IÑJÔJÐJÐJÐJr!   c                 óÆ   — | j                              ¦   «          |                      | j                             ¦   «         | j        dz   t          j        j        z   ¦  «         dS )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)ru  rZ  r£   r¿   r[  r†   rB   ro   rú   s    r   Útest_reportCursorPositionz3ServerProtocolOutputTests.test_reportCursorPosition´  s]   € ð 	Œ×*Ò*Ñ,Ô,Ð,Ø×ÒØŒN× Ò Ñ"Ô" D¤H¨t¡Oµk´oÔ6KÑ$Kñ	
ô 	
ð 	
ð 	
ð 	
r!   N)&rœ   r�   rž   r<   r2   r‰  r†   rý   ry  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Î  r5   r!   r   rr  rr  y  sN  € € € € € ðð ð #Ð
" 1 bÑ
)Ô
)€CØ
Ð(Ð(¨¨BÑ/Ô/Ñ
/€Cð5ð 5ð 5ð

ð 
ð 
ð
ð 
ð 
ð
ð 
ð 
ð
ð 
ð 
ð	
ð 	
ð 	
ðSð Sð Sð

ð 

ð 

ðQð Qð Qð:ð :ð :ð
ð 
ð 
ð
ð 
ð 
ð&
ð 
ð 
ðRð Rð RðRð Rð Rð

ð 

ð 

ðRð Rð RðRð Rð RðYð Yð YðYð Yð YðRð Rð RðYð Yð YðYð Yð Yð	
ð 	
ð 	
ðYð Yð YðYð Yð YðIð Ið IðJð Jð JðJð Jð JðKð Kð Kð

ð 

ð 

ð 

ð 

r!   rr  )3ÚtextwrapÚtypingr   r   Útwisted.conch.insults.insultsr   r   r   r   r	   r
   r   r   r   r   r   r   r   Útwisted.internet.protocolr   Útwisted.internet.testingr   Útwisted.python.compatr   Útwisted.python.constantsr   r   Útwisted.trialr   r    r#   r'   r+   Úobjectr‘   r2   rA   ÚdedentrB   rr   r   r    rÇ   r¯   ÚTestCaserÉ   rÕ   rÛ   rç   r÷   rr  r5   r!   r   ú<module>rÚ     sÍ  ðð
 €€€Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð /Ð .Ð .Ð .Ð .Ð .Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø +Ð +Ð +Ð +Ð +Ð +Ø :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ø "Ð "Ð "Ð "Ð "Ð "ð4ð 4ð 4ð)ð )ð )ð%ð %ð %ð"ð "ð "ð ˆ&‰(Œ(€ð3ð 3ð 3ð((ð (ð (ð *Ð)ØØð 	ÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐØÐÐð#ð& 	ˆŒð		ñ	ô 	ð-"ñ "ô "€ðJ )Ð(ØØà	ˆuˆØ	ˆuˆØ	�ˆØ	�ˆØ	ˆuˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	ˆuˆØ	�ˆØ	�ˆð!ð$ 	ˆŒð	ñ		ô 		ð+ñ ô €
ðDð ð ð ð ñ ô ð ðDð ð ð ð ñ ô ð ðÐ ð$2ð 2ð 2ð 2ð 2˜ñ 2ô 2ð 2ð$ ð-ð -ð -ð -ð -Ð-¨xÔ/@ñ -ô -ð -ð,@ð @ð @ð @ð @Ð1°8Ô3Dñ @ô @ð @ð6 -ð  -ð  -ð  -ð  -Ð0°(Ô2Cñ  -ô  -ð  -ðF-ð -ð -ð -ð -Ð 2°HÔ4Eñ -ô -ð -ð:P
ð P
ð P
ð P
ð P
 (Ô"3°Yñ P
ô P
ð P
ðlE
ð E
ð E
ð E
ð E
 Ô 1ñ E
ô E
ð E
ð E
ð E
r!   