Ë
    oj€}  ã                   óD  — 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 jJ                  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 jJ                  d@«      ¬"«      Z' G dA„ dB«      Z( G dC„ dD«      Z)dEZ* G dF„ dGe)«      Z+[* G dH„ dIe+ejX                  «      Z- G dJ„ dKe+ejX                  «      Z. G dL„ dMe+ejX                  «      Z/ G dN„ dOe+ejX                  «      Z0 G dP„ dQejX                  e)«      Z1 G dR„ dSejX                  «      Z2y)Té    N)ÚOptionalÚType)ÚBLINKÚCS_ALTERNATEÚCS_ALTERNATE_SPECIALÚ
CS_DRAWINGÚCS_UKÚCS_USÚG0ÚG1Ú	UNDERLINEÚClientProtocolÚServerProtocolÚmodesÚprivateModes)ÚProtocol)ÚStringTransport)Ú	iterbytes)ÚValueConstantÚValues)Úunittestc                 ó(   — t         t        | �  |«      S ©N)ÚsuperÚMockÚ__getattribute__)ÚmockÚnames     úA/usr/lib/python3/dist-packages/twisted/conch/test/test_insults.pyÚ_getattrr       s   € Ü”�tÑ-¨dÓ3Ð3ó    c                 ó   — t        | d«      S )NÚoccurrences©r    ©r   s    r   r#   r#   "   s   € Ü�D˜-Ó(Ð(r!   c                 ó   — t        | d«      S )NÚmethodsr$   r%   s    r   r'   r'   &   s   € Ü�D˜)Ó$Ð$r!   c                 ó8   — t        | «      j                  |«       y r   )r#   Úappend)r   Úobjs     r   Ú_appendr+   *   s   € Ü�Ó×Ñ˜SÕ!r!   c                 ó8   — 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Ó2Ð2r!   c                 óÚ   — t        |«      D ���� ci c]3  \  }}t        |«      D ]   \  }} | r| t        t        ||z   |«      «      “Œ" Œ5 }}}}} ||d<   t         t        f|«      S c c} }}}w )NÚ__doc__)Ú	enumerater   r2   Útyper   )r   Ú	colOffsetÚnamesÚdocÚjr1   ÚiÚattrss           r   Ú_makeControlFunctionSymbolsr=   E   s‡   € ô   Ó&÷ñ áˆAˆsÜ  “~òñ ˆAˆtÙð 	ŒmÔ4°Q¸±]ÀAÓFÓGÑGðØð€Eó ð €Eˆ)ÑÜ�”v�i Ó'Ð'ùõs   ‘8A%
ÚCSFinalByter-   )ÚICHÚDCHÚHPA)ÚCUUÚSSEÚHPR)ÚCUDÚCPRÚREP)ÚCUFÚSUÚDA)ÚCUBÚSDÚVPA)ÚCNLÚNPÚVPR)ÚCPLÚPPÚHVP)ÚCHAÚCTCÚTBC)ÚCUPÚECHÚSM)ÚCHTÚCVTÚMC)ÚEDÚCBTÚHPB)ÚELÚSRSÚVPB)ÚILÚPTXÚRM)ÚDLÚSDSÚSGR)ÚEFÚSIMDÚDSR)ÚEANÚDAQaW  
    Symbolic constants for all control sequence final bytes
    that do not imply intermediate bytes.  This happens to cover
    movement control sequences.

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

    Each L{ValueConstant} maps a control sequence name to L{bytes}
    )r7   r8   r9   Ú
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y)r   Nc                 óH   — g | _         |€i }|| _        |t        ur|| _        yy)z�
        @param methods: Mapping of names to return values
        @param callReturnValue: object __call__ should return
        N)r#   r'   ÚdefaultÚcallReturnValue)Úselfr'   rŽ   s      r   Ú__init__zMock.__init__ž   s2   € ð
 ˆÔØˆ?ØˆGØˆŒØ¤'Ñ)Ø#2ˆDÕ ð *r!   c                 ób   — t        | d«      }|t        u r
t        «       }t        | d|||f«       |S )NrŽ   Ú__call__)r    r�   r   r+   )r�   ÚaÚkwÚreturnValues       r   r’   zMock.__call__ª   s7   € Ü˜tÐ%6Ó7ˆØœ'Ñ!Ü›&ˆKä��z ;°°2Ð6Ô7ØÐr!   c                 óv   — t        | d«      }||v rt        ||   ¬«      }n
t        «       }t        | ||f«       |S )Nr'   )rŽ   )r    r   r+   )r�   r   r'   Ú	attrValues       r   r   zMock.__getattribute__²   s?   € Ü˜4 Ó+ˆØ�7‰?Ü¨W°T©]Ô;‰Iä›ˆIä��t˜YÐ'Ô(ØÐr!   )Ú__name__Ú
__module__Ú__qualname__r�   rŽ   r�   r’   r   © r!   r   r   r   ›   s   „ Ø€Oà#°Wó 
3òór!   r   c                   ó   — e Zd Zdi fd„Zy)Ú	MockMixinr›   c                 ó  — |\  }}| j                  ||«       | j                  t        t        |«      «      d«       t        |«      \  \  }}}	}
| j                  |d«       | j                  |	|«       | j                  |
|«       |S )Né   r’   )ÚassertEqualÚlenr#   )r�   Ú
occurrenceÚ
methodNameÚexpectedPositionalArgsÚexpectedKeywordArgsÚattrr   ÚcallÚresultÚargsr”   s              r   Ú
assertCallzMockMixin.assertCall¾   s„   € ð  ‰
ˆˆdØ×Ñ˜˜zÔ*Ø×Ñœœ[¨Ó.Ó/°Ô3Ü%0°Ó%6Ñ"Ñ	!ˆ$�˜˜bØ×Ñ˜˜zÔ*Ø×Ñ˜Ð5Ô6Ø×Ñ˜Ð0Ô1Øˆr!   N)r˜   r™   rš   rª   r›   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                   ób   — e Zd ZU dZeee      ed<   dD ]  \  ZZ	 e
eee	dœz  «       Œ [[	d„ Zy)ÚByteGroupingsMixinNÚprotocolFactory))ÚPairsé   )ÚTriplesé   )ÚQuadsr-   )ÚQuintsé   )ÚSexesé   )Ú	groupNameÚbytesPerc                 ó’   — | j                  t        |«      j                  d«      d|f«      }| j                  t        |«      g «       y )Nr   ÚmakeConnection)rª   r#   Úpopr    )r�   Ú	transportÚprotoÚparserr¨   s        r   ÚverifyResultsz ByteGroupingsMixin.verifyResultsê   s<   € Ø—‘¤¨UÓ!3×!7Ñ!7¸Ó!:Ð<LÈvÈiÓXˆØ×Ñœ VÓ,¨bÕ1r!   )r˜   r™   rš   r­   r   r   r   Ú__annotations__ÚwordÚnÚexecÚ_byteGroupingTestTemplater¿   r›   r!   r   r¬   r¬   Ý   sM   … Ø04€O�X˜d 8™nÑ-Ó4ðò M‰ˆˆañ 	Ð&°tÈÑ)KÑKÕLðMð 	ˆaó2r!   r¬   c                   ó   — e Zd ZeZdZd„ Zy)ÚServerArrowKeysTestss   [A[B[C[Dc                 ó^  — t         j                  | |||«       |j                  |j                  |j                  |j
                  fD ]J  }| j                  t        |«      j                  d«      d|d f«      }| j                  t        |«      g «       ŒL | j                  t        |«      «       y )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ð �O‰OØ×ÑØ×ÑØ×Ñð	
ò 		6ˆEð —_‘_Ü˜EÓ"×&Ñ& qÓ)Ð+>ÀÈÀóˆFð ×Ñœ[¨Ó0°"Õ5ð		6ð 	×Ñœ UÓ+Õ,r!   N©r˜   r™   rš   r   r­   Ú
TEST_BYTESr¿   r›   r!   r   rÆ   rÆ   ò   s   „ Ø$€Oð -€Jó-r!   rÆ   c                   ó   — e Zd ZeZdZd„ Zy)ÚPrintableCharactersTestss   abc123ABC!@#abc123c                 óè  — t         j                  | |||«       t        d«      D ]J  }| j                  t	        |«      j                  d«      d|d f«      }| j                  t	        |«      g «       ŒL t        d«      D ]T  }| j                  t	        |«      j                  d«      d||j                  f«      }| j                  t	        |«      g «       ŒV t	        |«      }| j                  ||›d�«       y )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ä˜oÓ.ò 	6ˆDØ—_‘_Ü˜EÓ"×&Ñ& qÓ)Ð+>ÀÀtÀóˆFð ×Ñœ[¨Ó0°"Õ5ð		6ô ˜iÓ(ò 	6ˆDØ—_‘_Ü˜EÓ"×&Ñ& qÓ)Ð+>ÀÀvÇzÁzÐ@RóˆFð ×Ñœ[¨Ó0°"Õ5ð		6ô ˜5Ó!ˆØ×Ñ˜ $ Ð)=Ð>Õ?r!   NrÏ   r›   r!   r   rÒ   rÒ     s   „ Ø$€Oð
 ?€Jó@r!   rÒ   c                   óz   — e Zd ZdZeZg ZdD ]  Zej                  dez   «       Œ dj                  e«      Z
[[d„ Zy)Ú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         j                  | |||«       t        dd«      D ]Z  }t        |d|fz  «      }| j	                  t        |«      j                  d«      d|d f«      }| j                  t        |«      g «       Œ\ | j                  t        |«      «       y )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Ü˜Q “|ò 	6ˆGÜ˜f e¨w¨jÑ&8Ó9ˆGØ—_‘_Ü˜EÓ"×&Ñ& qÓ)Ð+>ÀÈ$ÀóˆFð ×Ñœ[¨Ó0°"Õ5ð	6ð 	×Ñœ UÓ+Õ,r!   N)r˜   r™   rš   r4   r   r­   ÚbyteListÚ	byteCodesr)   ÚjoinrÐ   r¿   r›   r!   r   rØ   rØ   #  sM   „ ÙCà$€Oà€Hðò .ˆ	ð 	�‰˜ 9Ñ,Õ-ð.ð —‘˜(Ó#€JØ�)ó-r!   rØ   c                   óP   — 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
y)ÚClientCursorMovementTestss   [2Bs   [4Cs   [As   [2Dc                 ó  — t         j                  | |||«       dD ]O  \  }}| j                  t        |«      j	                  d«      d|z   |f«      }| j                  t        |«      g «       ŒQ | j                  t        |«      «       y )N))ÚDownr¯   )ÚForwardr-   ©ÚUprŸ   ©ÚBackwardr¯   rè   rê   r   Úcursor)r¬   r¿   rª   r#   r»   r    rÍ   )r�   r¼   r½   r¾   ÚmethodÚcountr¨   s          r   r¿   z'ClientCursorMovementTests.verifyResultsQ  s…   € Ü×(Ñ(¨¨y¸%ÀÔHð
ò 	6‰MˆF�Eð —_‘_Ü˜EÓ"×&Ñ& qÓ)¨8°fÑ+<¸u¸hóˆFð ×Ñœ[¨Ó0°"Õ5ð	6ð 	×Ñœ UÓ+Õ,r!   N)r˜   r™   rš   r   r­   Úd2Úr4Úu1Úl2rÐ   r¿   r›   r!   r   rä   rä   F  sE   „ Ø$€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y)ÚClientControlSequencesTestsc                 óˆ  ‡ — t        «       ‰ _        t        «       ‰ _        t	        ˆ fd„«      ‰ _        ‰ ‰ j
                  _        ‰ j
                  j                  ‰ j                  «       ‰ j                  t        ‰ j                  «      j                  d«      d‰ j
                  f«      }‰ j                  t        |«      «       y )Nc                  ó   •— ‰ j                   S r   )r½   ©r�   s   €r   ú<lambda>z3ClientControlSequencesTests.setUp.<locals>.<lambda>g  s   ø€ ¨T¯Z©Z€ r!   r   rº   )r   r¼   r   r½   r   r¾   Úfactoryrº   rª   r#   r»   rÍ   )r�   r¨   s   ` r   ÚsetUpz!ClientControlSequencesTests.setUpd  sŠ   ø€ Ü(Ó*ˆŒÜ“VˆŒ
Ü$Ó%7Ó8ˆŒØ"ˆ�‰ÔØ�‰×"Ñ" 4§>¡>Ô2Ø—‘Ü˜Ÿ
™
Ó#×'Ñ'¨Ó*Ð,<¸t¿{¹{¸nó
ˆð 	×Ñœ VÓ,Õ-r!   c                 ó`  — | j                   j                  dj                  d„ t        d«      D «       «      «       t	        | j
                  «      }dD ]I  }dD ]B  }| j                  |j                  d«      d|z   |f«      }| j                  t	        |«      «       ŒD ŒK | j                  |«       y )Nr!   c              3   ó:   K  — | ]  }d D ]  }d|z   |z   –— Œ Œ y­w))r!   ó   2s   20s   200rÙ   Nr›   )Ú.0ÚchrÂ   s      r   ú	<genexpr>zBClientControlSequencesTests.testSimpleCardinals.<locals>.<genexpr>q  s6   è ø€ ò àØ3òð ð ˜1‘˜rÕ!ðØ!ñùs   ‚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ˆDØ(ò 6�ØŸ™¨¯©°!«°hÀ±oÈÀxÓP�Ø× Ñ ¤¨VÓ!4Õ5ñ6ð	6ð 	×Ñ˜Õr!   c                 óv  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      dd«      }| j                  t        |«      «       | j	                  |j                  d«      dd«      }| j                  t        |«      «       | j                  |«       y )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Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£Ð.?ÀÓIˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£Ð.?ÀÓNˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ób  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      dd«      }| j                  t        |«      «       | j	                  |j                  d«      dd«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   #3#4#5#6r   ÚdoubleHeightLine)T)FÚsingleWidthLineÚdoubleWidthLiner	  r
  s      r   ÚtestHeightAndWidthz.ClientControlSequencesTests.testHeightAndWidthŠ  så   € Ø�‰× Ñ Ð!<Ô=Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£Ð.@À'ÓJˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£Ð.@À(ÓKˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£Ð.?Ó@ˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£Ð.?Ó@ˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ó"  — | j                   j                  dj                  t        d«      D ��cg c]0  }dj                  t        d«      D �cg c]
  }d|z   |z   ‘Œ c}«      ‘Œ2 c}}«      «       t	        | j
                  «      }t        t        fD ]`  }t        t        t        t        t        fD ]@  }| j                  |j                  d«      d||f«      }| j                  t	        |«      «       ŒB Œb | j                  |«       y c c}w c c}}w )Nr!   s   ()s   AB012ó   r   ÚselectCharacterSet)r¾   r  râ   r   r#   r½   r   r   r	   r
   r   r   r   rª   r»   rÍ   )r�   ÚgrÂ   rÖ   ÚwhichÚcharsetr¨   s          r   ÚtestCharacterSetz,ClientControlSequencesTests.testCharacterSet›  sö   € Ø�‰× Ñ Ø�H‰Hô ' uÓ-÷àð —H‘H´yÀÓ7JÖK°!˜g¨™k¨A›oÒKÕLóóô	
ô ˜4Ÿ:™:Ó&ˆäœ"�Xò 	6ˆEäÜÜÜÜ$ðò 
6�ð Ÿ™Ø—H‘H˜Q“KÐ!5¸ÀÐ7Gó�ð × Ñ ¤¨VÓ!4Õ5ñ
6ð	6ð 	×Ñ˜Õùò' Lùós   ¯DÁDÁ	DÄDc                 ór  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   r   ÚshiftInÚshiftOutr	  r
  s      r   ÚtestShiftingz(ClientControlSequencesTests.testShifting´  s†   € Ø�‰× Ñ  Ô-Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£¨iÓ8ˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£¨jÓ9ˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ór  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   NOr   ÚsingleShift2ÚsingleShift3r	  r
  s      r   ÚtestSingleShiftsz,ClientControlSequencesTests.testSingleShifts¿  s†   € Ø�‰× Ñ  Ô/Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£¨nÓ=ˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£¨nÓ=ˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ór  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   =>r   ÚapplicationKeypadModeÚnumericKeypadModer	  r
  s      r   ÚtestKeypadModez*ClientControlSequencesTests.testKeypadModeÊ  sˆ   € Ø�‰× Ñ  Ô/Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£Ð.EÓFˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£Ð.AÓBˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ór  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   78r   Ú
saveCursorÚrestoreCursorr	  r
  s      r   Ú
testCursorz&ClientControlSequencesTests.testCursorÕ  s†   € Ø�‰× Ñ  Ô/Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£¨lÓ;ˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£¨oÓ>ˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 óü   — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   cr   Úresetr	  r
  s      r   Ú	testResetz%ClientControlSequencesTests.testResetà  s[   € Ø�‰× Ñ  Ô*Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£¨gÓ6ˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 óè  — | j                   j                  d«       t        | j                  «      }| j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j	                  |j                  d«      d«      }| j                  t        |«      «       | j                  |«       y )Ns   DMEr   ÚindexÚreverseIndexÚnextLiner	  r
  s      r   Ú	testIndexz%ClientControlSequencesTests.testIndexè  s²   € Ø�‰× Ñ Ð!3Ô4Ü˜4Ÿ:™:Ó&ˆà—‘ §¡¨!£¨gÓ6ˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£¨nÓ=ˆØ×Ñœ VÓ,Ô-à—‘ §¡¨!£¨jÓ9ˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c           	      óˆ  — | j                   j                  ddj                  d„ t        j                  t        j
                  t        j                  fD «       «      z   dz   «       | j                   j                  ddj                  d„ t        j                  t        j
                  t        j                  fD «       «      z   dz   «       t        | j                  «      }| j                  |j                  d«      dt        j                  t        j
                  t        j                  gf«      }| j                  t        |«      «       | j                  |j                  d«      d	t        j                  t        j
                  t        j                  gf«      }| j                  t        |«      «       | j                  |«       y )
NrÙ   ó   ;c              3   ó(   K  — | ]
  }d |fz  –— Œ y­w©s   %dNr›   ©rþ   Úms     r   r   z8ClientControlSequencesTests.testModes.<locals>.<genexpr>ù  ó   è ø€ ÒP¨˜  �ÑPùó   ‚ó   hc              3   ó(   K  — | ]
  }d |fz  –— Œ y­wr3  r›   r4  s     r   r   z8ClientControlSequencesTests.testModes.<locals>.<genexpr>þ  r6  r7  ó   lr   ÚsetModesÚ
resetModes)r¾   r  râ   r   ÚKAMÚIRMÚLNMr#   r½   rª   r»   rÍ   r
  s      r   Ú	testModesz%ClientControlSequencesTests.testModesö  sB  € Ø�‰× Ñ ØØ�i‰iÑP¬u¯y©y¼%¿)¹)ÄUÇYÁYÐ.OÔPÓPñQàñô	
ð
 	�‰× Ñ ØØ�i‰iÑP¬u¯y©y¼%¿)¹)ÄUÇYÁYÐ.OÔPÓPñQàñô	
ô
 ˜4Ÿ:™:Ó&ˆà—‘Ø�H‰H�Q‹K˜¤u§y¡y´%·)±)¼U¿Y¹YÐ&GÐ%Ió
ˆð 	×Ñœ VÓ,Ô-à—‘Ø�H‰H�Q‹K˜¬¯©´E·I±I¼u¿y¹yÐ(IÐ'Kó
ˆð 	×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ó‚  — | j                   j                  d«       t        | j                  «      }dD ]=  }| j	                  |j                  d«      |«      }| j                  t        |«      «       Œ? | j	                  |j                  d«      dd«      }| j                  t        |«      «       | j                  |«       y )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Ü˜4Ÿ:™:Ó&ˆð
ò 		2ˆDð —_‘_ T§X¡X¨a£[°$Ó7ˆFØ×Ñœ[¨Ó0Õ1ð		2ð —‘ §¡¨!£Ð.?ÀÓFˆØ×Ñœ VÓ,Ô-Ø×Ñ˜Õr!   c                 ó  — | j                   j                  d«       t        | j                  «      }dD ]?  }| j	                  |j                  d«      d|f«      }| j                  t        |«      «       ŒA | j                  |«       y )Ns   [M[3M©rŸ   r±   r   Ú
deleteLiner	  ©r�   rÖ   Úargr¨   s       r   ÚtestLineDeletionz,ClientControlSequencesTests.testLineDeletion!  óq   € Ø�‰× Ñ Ð!1Ô2Ü˜4Ÿ:™:Ó&ˆàò 	2ˆCØ—_‘_ T§X¡X¨a£[°,ÀÀÓGˆFØ×Ñœ[¨Ó0Õ1ð	2ð 	×Ñ˜Õr!   c                 ó  — | j                   j                  d«       t        | j                  «      }dD ]?  }| j	                  |j                  d«      d|f«      }| j                  t        |«      «       ŒA | j                  |«       y )Ns   [L[3LrK  r   Ú
insertLiner	  rM  s       r   ÚtestLineInsertionz-ClientControlSequencesTests.testLineInsertion*  rP  r!   c                 óN  — dt        | j                  «      d<   | j                  j                  d«       | j	                  | j
                  j                  «       d«       t        | j                  «      }| j                  |j                  d«      d«      }| j	                  |d«       y )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ˆð 	×Ñ˜ Õ(r!   c                 ó"  — t        | j                  «      }| j                  j                  d«       | j	                  |j                  d«      dd«       | j                  j                  d«       | j	                  |j                  d«      dd«       y)z®
        Contiguous non-control bytes are passed to a single call to the
        C{write} method of the terminal to which the L{ClientProtocol} is
        connected.
        ó   ar   Úwrite)rZ  ó   bc)r\  N)r#   r½   r¾   r  rª   r»   )r�   rÖ   s     r   Útest_applicationDataBytesz5ClientControlSequencesTests.test_applicationDataBytes>  sf   € ô ˜4Ÿ:™:Ó&ˆØ�‰× Ñ  Ô&Ø�‰˜Ÿ™ › W¨gÔ6Ø�‰× Ñ  Ô'Ø�‰˜Ÿ™ › W¨hÕ7r!   c                 óú   — t        | j                  «      }| j                  j                  |«       |r4 | j                  |j                  d«      g|j                  d«      ¢­Ž  |rŒ4| j                  |d|›�«       y )Nr   zNo other calls should happen: )r#   r½   r¾   r  rª   r»   rÍ   )r�   ÚdataÚcallsrÖ   s       r   Ú_applicationDataTestz0ClientControlSequencesTests._applicationDataTestJ  se   € Ü˜4Ÿ:™:Ó&ˆØ�‰× Ñ  Ô&ÙØˆD�O‰O˜DŸH™H Q›KÐ7¨%¯)©)°A«,Ó7ò à×Ñ˜Ð!?À¸xÐHÕIr!   c                 ó,   — | j                  dddg«       y)z£
        Application data bytes followed by a shift-in command are passed to a
        call to C{write} before the terminal's C{shiftIn} method is called.
        s   ab©r[  )s   ab)r  N©ra  r÷   s    r   Ú test_shiftInAfterApplicationDataz<ClientControlSequencesTests.test_shiftInAfterApplicationDataQ  s   € ð
 	×!Ñ! )Ð.AÀ<Ð-PÕQr!   c                 ó,   — | j                  dddg«       y)z¥
        Application data bytes followed by a shift-out command are passed to a
        call to C{write} before the terminal's C{shiftOut} method is called.
        s   abrc  )r  Nrd  r÷   s    r   Ú!test_shiftOutAfterApplicationDataz=ClientControlSequencesTests.test_shiftOutAfterApplicationDataX  s   € ð
 	×!Ñ! )Ð.AÀ=Ð-QÕRr!   c                 ó,   — | j                  dddg«       y)z¹
        Application data bytes followed by a cursor-backward command are passed
        to a call to C{write} before the terminal's C{cursorBackward} method is
        called.
        s   abrc  )ÚcursorBackwardNrd  r÷   s    r   Ú'test_cursorBackwardAfterApplicationDatazCClientControlSequencesTests.test_cursorBackwardAfterApplicationData_  s   € ð 	×!Ñ! )Ð.AÐCVÐ-WÕXr!   c                 ó\   — | j                  dddg«       | j                  ddddgffg«       y)z¸
        Application data bytes followed by an escape character are passed to a
        call to C{write} before the terminal's handler method for the escape is
        called.
        s   abDrc  )r,  s   ab[4hr;  r-   Nrd  r÷   s    r   Útest_escapeAfterApplicationDataz;ClientControlSequencesTests.test_escapeAfterApplicationDatag  s>   € ð 	×!Ñ! *Ð/BÀJÐ.OÔPð 	×!Ñ!ØÐ.°¸q¸c¸VÐ0DÐEõ	
r!   N)r˜   r™   rš   rú   r  r  r  r  r  r  r#  r'  r*  r/  r@  rI  rO  rS  rX  r]  ra  re  rg  rj  rl  r›   r!   r   rô   rô   c  st   „ ò	.òò 	òò"ò2	ò	ò	ò	òòòò0ò&òò	)ò
8òJòRòSò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%y$)%ÚServerProtocolOutputTestszh
    Tests for the bytes L{ServerProtocol} writes to its transport when its
    methods are called.
    rŸ   é   r´   c                 óŠ   — t        «       | _        t        «       | _        | j                  j	                  | j                  «       y r   )r   Úprotocolr   r¼   rº   r÷   s    r   rú   zServerProtocolOutputTests.setUp…  s,   € Ü&Ó(ˆŒÜ(Ó*ˆŒØ�‰×$Ñ$ T§^¡^Õ4r!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z�
        L{ServerProtocol.cursorUp} writes the control sequence
        ending with L{CSFinalByte.CUU} to its transport.
        rŸ   ó   1N)rq  ÚcursorUpr    r¼   rW  r‚   r>   rB   r÷   s    r   Útest_cursorUpz'ServerProtocolOutputTests.test_cursorUpŠ  sM   € ð
 	�‰×Ñ˜qÔ!Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨t¡O´k·o±o×6KÑ6KÑ$Kõ	
r!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)zƒ
        L{ServerProtocol.cursorDown} writes the control sequence
        ending with L{CSFinalByte.CUD} to its transport.
        rŸ   rs  N)rq  Ú
cursorDownr    r¼   rW  r‚   r>   rE   r÷   s    r   Útest_cursorDownz)ServerProtocolOutputTests.test_cursorDown”  sM   € ð
 	�‰× Ñ  Ô#Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨t¡O´k·o±o×6KÑ6KÑ$Kõ	
r!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z†
        L{ServerProtocol.cursorForward} writes the control sequence
        ending with L{CSFinalByte.CUF} to its transport.
        rŸ   rs  N)rq  ÚcursorForwardr    r¼   rW  r‚   r>   rH   r÷   s    r   Útest_cursorForwardz,ServerProtocolOutputTests.test_cursorForwardž  sM   € ð
 	�‰×#Ñ# AÔ&Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨t¡O´k·o±o×6KÑ6KÑ$Kõ	
r!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z‡
        L{ServerProtocol.cursorBackward} writes the control sequence
        ending with L{CSFinalByte.CUB} to its transport.
        rŸ   rs  N)rq  ri  r    r¼   rW  r‚   r>   rK   r÷   s    r   Útest_cursorBackwardz-ServerProtocolOutputTests.test_cursorBackward¨  sM   € ð
 	�‰×$Ñ$ QÔ'Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨t¡O´k·o±o×6KÑ6KÑ$Kõ	
r!   c                 óà   — | j                   j                  dd«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)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)rq  ÚcursorPositionr    r¼   rW  r‚   r>   rW   r÷   s    r   Útest_cursorPositionz-ServerProtocolOutputTests.test_cursorPosition²  sP   € ð 	�‰×$Ñ$ Q¨Ô*Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨vÑ$5¼¿¹×8MÑ8MÑ$Mõ	
r!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)z±
        L{ServerProtocol.cursorHome} writes a control sequence ending
        with L{CSFinalByte.CUP} and no parameters, so that the client
        defaults to (1, 1).
        N)rq  Ú
cursorHomer    r¼   rW  r‚   r>   rW   r÷   s    r   Útest_cursorHomez)ServerProtocolOutputTests.test_cursorHome½  sD   € ð 	�‰× Ñ Ô"Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¼K¿O¹O×<QÑ<QÑ1QÕRr!   c                 óº   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        dd«      z   «       y)z´
        L{ServerProtocol.index} writes the control sequence ending in
        the 8-bit code table coordinates 4, 4.

        Note that ECMA48 5th Edition removes C{IND}.
        r-   N)rq  r,  r    r¼   rW  ÚESCr2   r÷   s    r   Ú
test_indexz$ServerProtocolOutputTests.test_indexÆ  sE   € ð 	�‰×ÑÔØ×ÑØ�N‰N× Ñ Ó" D§H¡HÔ/GÈÈ1Ó/MÑ$Mõ	
r!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)zt
        L{ServerProtocol.reverseIndex} writes the control sequence
        ending in the L{C1SevenBit.RI}.
        N)rq  r-  r    r¼   rW  r…  rn   r…   r÷   s    r   Útest_reverseIndexz+ServerProtocolOutputTests.test_reverseIndexÒ  sD   € ð
 	�‰×"Ñ"Ô$Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¼J¿M¹M×<OÑ<OÑ1OÕPr!   c                 óŒ   — | j                   j                  «        | j                  | j                  j	                  «       d«       y)zM
        L{ServerProtocol.nextLine} writes C{"
"} to its transport.
        s   
N)rq  r.  r    r¼   rW  r÷   s    r   Útest_nextLinez'ServerProtocolOutputTests.test_nextLineÚ  s1   € ð 	�‰×ÑÔ Ø×Ñ˜Ÿ™×-Ñ-Ó/°Õ9r!   c                 óh  — t         j                  t         j                  t         j                  g}| j                  j                  |«       | j                  | j                  j                  «       | j                  dj                  d„ |D «       «      z   t        j                  j                  z   «       y)zš
        L{ServerProtocol.setModes} writes a control sequence
        containing the requested modes and ending in the
        L{CSFinalByte.SM}.
        r1  c              3   ó(   K  — | ]
  }d |fz  –— Œ y­wr3  r›   r4  s     r   r   z:ServerProtocolOutputTests.test_setModes.<locals>.<genexpr>ï  ó   è ø€ Ò9¨˜  �Ñ9ùr7  N)r   r=  r>  r?  rq  r;  r    r¼   rW  r‚   râ   r>   rY   ©r�   Ú
modesToSets     r   Útest_setModesz'ServerProtocolOutputTests.test_setModesä  s|   € ô —i‘i¤§¡¬E¯I©IÐ6ˆ
Ø�‰×Ñ˜zÔ*Ø×ÑØ�N‰N× Ñ Ó"Ø�H‰HØ�i‰iÑ9¨jÔ9Ó9ñ:ä�n‰n×"Ñ"ñ#õ	
r!   c                 óh  — t         j                  t         j                  t         j                  g}| j                  j                  |«       | j                  | j                  j                  «       | j                  dj                  d„ |D «       «      z   t        j                  j                  z   «       y)zª
        L{ServerProtocol.setPrivatesModes} writes a control sequence
        containing the requested private modes and ending in the
        L{CSFinalByte.SM}.
        r1  c              3   ó(   K  — | ]
  }d |fz  –— Œ y­wr3  r›   r4  s     r   r   zAServerProtocolOutputTests.test_setPrivateModes.<locals>.<genexpr>  s   è ø€ Ò@¨˜  �Ñ@ùr7  N)r   ÚERRORÚCOLUMNÚORIGINrq  r;  r    r¼   rW  r‚   râ   r>   rY   )r�   ÚprivateModesToSets     r   Útest_setPrivateModesz.ServerProtocolOutputTests.test_setPrivateModesó  sŒ   € ô ×ÑÜ×ÑÜ×Ñð
Ðð
 	�‰×ÑÐ0Ô1Ø×ÑØ�N‰N× Ñ Ó"Ø�H‰HØ�i‰iÑ@Ð.?Ô@Ó@ñAä�n‰n×"Ñ"ñ#õ	
r!   c                 óh  — t         j                  t         j                  t         j                  g}| j                  j                  |«       | j                  | j                  j                  «       | j                  dj                  d„ |D «       «      z   t        j                  j                  z   «       y)zs
        L{ServerProtocol.resetModes} writes the control sequence
        ending in the L{CSFinalByte.RM}.
        r1  c              3   ó(   K  — | ]
  }d |fz  –— Œ y­wr3  r›   r4  s     r   r   z<ServerProtocolOutputTests.test_resetModes.<locals>.<genexpr>  r�  r7  N)r   r=  r>  r?  rq  r<  r    r¼   rW  r‚   râ   r>   re   rŽ  s     r   Útest_resetModesz)ServerProtocolOutputTests.test_resetModes  s|   € ô
 —i‘i¤§¡¬E¯I©IÐ6ˆ
Ø�‰× Ñ  Ô,Ø×ÑØ�N‰N× Ñ Ó"Ø�H‰HØ�i‰iÑ9¨jÔ9Ó9ñ:ä�n‰n×"Ñ"ñ#õ	
r!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)zp
        L{ServerProtocol.singleShift2} writes an escape sequence
        followed by L{C1SevenBit.SS2}
        N)rq  r  r    r¼   rW  r…  rn   r‡   r÷   s    r   Útest_singleShift2z+ServerProtocolOutputTests.test_singleShift2  óD   € ð
 	�‰×"Ñ"Ô$Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¼J¿N¹N×<PÑ<PÑ1PÕQr!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)zp
        L{ServerProtocol.singleShift3} writes an escape sequence
        followed by L{C1SevenBit.SS3}
        N)rq  r  r    r¼   rW  r…  rn   r‰   r÷   s    r   Útest_singleShift3z+ServerProtocolOutputTests.test_singleShift3  r�  r!   c                 ó.  — | j                   j                  t        t        «      t        t        «      «       | j                  | j                  j                  «       | j                  dt        t        fz  z   t        j                  j                  z   «       y)z«
        L{ServerProtocol.selectGraphicRendition} writes a control
        sequence containing the requested attributes and ending with
        L{CSFinalByte.SGR}
        s   %d;%dN)rq  ÚselectGraphicRenditionÚstrr   r   r    r¼   rW  r‚   r>   rh   r÷   s    r   Útest_selectGraphicRenditionz5ServerProtocolOutputTests.test_selectGraphicRendition$  sc   € ð 	�‰×,Ñ,¬S´«Z¼¼Y»ÔHØ×ÑØ�N‰N× Ñ Ó"Ø�H‰H�x¤5¬)Ð"4Ñ4Ñ4´{·±×7LÑ7LÑLõ	
r!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)zz
        L{ServerProtocol.horizontalTabulationSet} writes the escape
        sequence ending in L{C1SevenBit.HTS}
        N)rq  ÚhorizontalTabulationSetr    r¼   rW  r…  rn   r|   r÷   s    r   Útest_horizontalTabulationSetz6ServerProtocolOutputTests.test_horizontalTabulationSet0  sD   € ð
 	�‰×-Ñ-Ô/Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¼J¿N¹N×<PÑ<PÑ1PÕQr!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)a  
        L{ServerProtocol.eraseToLineEnd} writes the control sequence
        sequence ending in L{CSFinalByte.EL} and no parameters,
        forcing the client to default to 0 (from the active present
        position's current location to the end of the line.)
        N)rq  rB  r    r¼   rW  r‚   r>   r`   r÷   s    r   Útest_eraseToLineEndz-ServerProtocolOutputTests.test_eraseToLineEnd8  sD   € ð 	�‰×$Ñ$Ô&Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¼K¿N¹N×<PÑ<PÑ1PÕQr!   c                 óÜ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)a	  
        L{ServerProtocol.eraseToLineBeginning} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 1 (from the beginning of the line up to and include the
        active present position's current location.)
        rs  N)rq  rC  r    r¼   rW  r‚   r>   r`   r÷   s    r   Útest_eraseToLineBeginningz3ServerProtocolOutputTests.test_eraseToLineBeginningB  sH   € ð 	�‰×*Ñ*Ô,Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸D±Ä;Ç>Á>×CWÑCWÑ1WÕXr!   c                 óÜ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z¦
        L{ServerProtocol.eraseLine} writes the control
        sequence sequence ending in L{CSFinalByte.EL} and a parameter
        of 2 (the entire line.)
        rý   N)rq  rD  r    r¼   rW  r‚   r>   r`   r÷   s    r   Útest_eraseLinez(ServerProtocolOutputTests.test_eraseLineL  sH   € ð 	�‰×ÑÔ!Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸D±Ä;Ç>Á>×CWÑCWÑ1WÕXr!   c                 óÖ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  t        j                  j                  z   «       y)a  
        L{ServerProtocol.eraseToDisplayEnd} writes the control
        sequence sequence ending in L{CSFinalByte.ED} and no parameters,
        forcing the client to default to 0 (from the active present
        position's current location to the end of the page.)
        N)rq  rE  r    r¼   rW  r‚   r>   r]   r÷   s    r   Útest_eraseToDisplayEndz0ServerProtocolOutputTests.test_eraseToDisplayEndU  sD   € ð 	�‰×'Ñ'Ô)Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¼K¿N¹N×<PÑ<PÑ1PÕQr!   c                 óÜ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)a  
        L{ServerProtocol.eraseToDisplayBeginning} writes the control
        sequence sequence ending in L{CSFinalByte.ED} a parameter of 1
        (from the beginning of the page up to and include the active
        present position's current location.)
        rs  N)rq  rF  r    r¼   rW  r‚   r>   r]   r÷   s    r   Útest_eraseToDisplayBeginningz6ServerProtocolOutputTests.test_eraseToDisplayBeginning_  sH   € ð 	�‰×-Ñ-Ô/Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸D±Ä;Ç>Á>×CWÑCWÑ1WÕXr!   c                 óÜ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z¤
        L{ServerProtocol.eraseDisplay} writes the control sequence
        sequence ending in L{CSFinalByte.ED} a parameter of 2 (the
        entire page)
        rý   N)rq  rG  r    r¼   rW  r‚   r>   r]   r÷   s    r   Útest_eraseToDisplayz-ServerProtocolOutputTests.test_eraseToDisplayi  sH   € ð 	�‰×"Ñ"Ô$Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸D±Ä;Ç>Á>×CWÑCWÑ1WÕXr!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z®
        L{ServerProtocol.deleteCharacter} writes the control sequence
        containing the number of characters to delete and ending in
        L{CSFinalByte.DCH}
        r-   ó   4N)rq  rH  r    r¼   rW  r‚   r>   r@   r÷   s    r   Útest_deleteCharacterz.ServerProtocolOutputTests.test_deleteCharacterr  sM   € ð 	�‰×%Ñ% aÔ(Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨t¡O´k·o±o×6KÑ6KÑ$Kõ	
r!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z£
        L{ServerProtocol.insertLine} writes the control sequence
        containing the number of lines to insert and ending in
        L{CSFinalByte.IL}
        r´   ó   5N)rq  rR  r    r¼   rW  r‚   r>   rc   r÷   s    r   Útest_insertLinez)ServerProtocolOutputTests.test_insertLine}  óJ   € ð 	�‰× Ñ  Ô#Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸D±Ä;Ç>Á>×CWÑCWÑ1WÕXr!   c                 óÞ   — | j                   j                  d«       | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)z£
        L{ServerProtocol.deleteLine} writes the control sequence
        containing the number of lines to delete and ending in
        L{CSFinalByte.DL}
        r¶   ó   6N)rq  rL  r    r¼   rW  r‚   r>   rf   r÷   s    r   Útest_deleteLinez)ServerProtocolOutputTests.test_deleteLine†  r¹  r!   c                 ó¬   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  dz   dz   «       y)z¶
        With no arguments, L{ServerProtocol.setScrollRegion} writes a
        control sequence with no parameters, but a parameter
        separator, and ending in C{b'r'}.
        r1  ó   rN©rq  r  r    r¼   rW  r‚   r÷   s    r   Útest_setScrollRegionNoArgsz4ServerProtocolOutputTests.test_setScrollRegionNoArgs�  s>   € ð 	�‰×%Ñ%Ô'Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸D±À4Ñ1GÕHr!   c                 ó°   — | j                   j                  d¬«       | j                  | j                  j	                  «       | j
                  dz   dz   «       y)zÍ
        With just a value for its C{first} argument,
        L{ServerProtocol.setScrollRegion} writes a control sequence with
        that parameter, a parameter separator, and finally a C{b'r'}.
        rŸ   )Úfirsts   1;r¾  Nr¿  r÷   s    r   Útest_setScrollRegionJustFirstz7ServerProtocolOutputTests.test_setScrollRegionJustFirst˜  sD   € ð 	�‰×%Ñ%¨AÐ%Ô.Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸EÑ1AÀDÑ1HÕIr!   c                 ó°   — | j                   j                  d¬«       | j                  | j                  j	                  «       | j
                  dz   dz   «       y)zÌ
        With just a value for its C{last} argument,
        L{ServerProtocol.setScrollRegion} writes a control sequence with
        a parameter separator, that parameter, and finally a C{b'r'}.
        rŸ   )Úlasts   ;1r¾  Nr¿  r÷   s    r   Útest_setScrollRegionJustLastz6ServerProtocolOutputTests.test_setScrollRegionJustLast¡  sD   € ð 	�‰×%Ñ%¨1Ð%Ô-Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸EÑ1AÀDÑ1HÕIr!   c                 ó²   — | j                   j                  dd¬«       | j                  | j                  j	                  «       | j
                  dz   dz   «       y)zæ
        When given both C{first} and C{last}
        L{ServerProtocol.setScrollRegion} writes a control sequence with
        the first parameter, a parameter separator, the last
        parameter, and finally a C{b'r'}.
        rŸ   r¯   )rÂ  rÅ  s   1;2r¾  Nr¿  r÷   s    r   Ú test_setScrollRegionFirstAndLastz:ServerProtocolOutputTests.test_setScrollRegionFirstAndLastª  sF   € ð 	�‰×%Ñ%¨A°AÐ%Ô6Ø×Ñ˜Ÿ™×-Ñ-Ó/°·±¸FÑ1BÀTÑ1IÕJr!   c                 óÜ   — | j                   j                  «        | j                  | j                  j	                  «       | j
                  dz   t        j                  j                  z   «       y)zÝ
        L{ServerProtocol.reportCursorPosition} writes a control
        sequence ending in L{CSFinalByte.DSR} with a parameter of 6
        (the Device Status Report returns the current active
        position.)
        r»  N)rq  rV  r    r¼   rW  r‚   r>   rk   r÷   s    r   Útest_reportCursorPositionz3ServerProtocolOutputTests.test_reportCursorPosition´  sK   € ð 	�‰×*Ñ*Ô,Ø×ÑØ�N‰N× Ñ Ó" D§H¡H¨t¡O´k·o±o×6KÑ6KÑ$Kõ	
r!   N)&r˜   r™   rš   r4   r2   r…  r‚   rú   ru  rx  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›   r!   r   rn  rn  y  sÓ   „ ññ # 1 bÓ
)€CØ
Ñ(¨¨BÓ/Ñ
/€Cò5ò

ò
ò
ò
ò	
òSò

òQò:ò
ò
ò&
òRòRò

òRòRòYòYòRòYòYò	
òYòYòIòJòJòKó

r!   rn  )3ÚtextwrapÚ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   r=   Údedentr>   rn   r   r�   rÄ   r¬   ÚTestCaserÆ   rÒ   rØ   rä   rô   rn  r›   r!   r   ú<module>rÖ     s  ðó
 ß !÷÷ ÷ õ õ /Ý 4Ý +ß :Ý "ò4ò)ò%ò"ñ ‹(€ò3ò((ñ *ØØò 	ÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚð#ð& 	ˆ�‰ð		ó	ô-"€ñJ )ØØà	ˆuˆØ	ˆuˆØ	�ˆØ	�ˆØ	ˆuˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	�ˆØ	ˆuˆØ	�ˆØ	�ˆð!ð$ 	ˆ�‰ð	ó		ô+€
÷Dñ ÷Dñ ðÐ ô$2˜ô 2ð$ ô-Ð-¨x×/@Ñ/@ô -ô,@Ð1°8×3DÑ3Dô @ô6 -Ð0°(×2CÑ2Cô  -ôF-Ð 2°H×4EÑ4Eô -ô:P
 (×"3Ñ"3°Yô P
ôlE
 × 1Ñ 1õ E
r!   