
    Yf                     P    d dl mZ d dlmZ d dlmZ  G d dej                  ZdS )    )text)
attributes)unittestc                   Z    e Zd ZdZddZddZddZddZddZdd	Z	dd
Z
ddZddZdS )FormattedTextTestsz.
    Tests for assembling formatted text.
    returnNc                 v    |                      t          j        t          j        d                   d           dS )zu
        Using no formatting attributes produces no VT102 control sequences in
        the flattened output.
        Hello, world.N)assertEqualr   assembleFormattedTextAnormalselfs    N/var/www/html/env/lib/python3.11/site-packages/twisted/conch/test/test_text.pytest_trivialzFormattedTextTests.test_trivial   s=    
 	&qx'@AA?	
 	
 	
 	
 	
    c                 v    |                      t          j        t          j        d                   d           dS )z
        The bold formatting attribute, L{A.bold}, emits the VT102 control
        sequence to enable bold when flattened.
        r
   z[1mHello, world.N)r   r   r   r   boldr   s    r   	test_boldzFormattedTextTests.test_bold   s>    
 	&qvo'>??AW	
 	
 	
 	
 	
r   c                 v    |                      t          j        t          j        d                   d           dS )z
        The underline formatting attribute, L{A.underline}, emits the VT102
        control sequence to enable underlining when flattened.
        r
   z[4mHello, world.N)r   r   r   r   	underliner   s    r   test_underlinez!FormattedTextTests.test_underline!   s>    
 	&q{?'CDD"	
 	
 	
 	
 	
r   c                 v    |                      t          j        t          j        d                   d           dS )z
        The blink formatting attribute, L{A.blink}, emits the VT102 control
        sequence to enable blinking when flattened.
        r
   z[5mHello, world.N)r   r   r   r   blinkr   s    r   
test_blinkzFormattedTextTests.test_blink+   s>    
 	&qw'?@@BX	
 	
 	
 	
 	
r   c                 v    |                      t          j        t          j        d                   d           dS )z
        The reverse-video formatting attribute, L{A.reverseVideo}, emits the
        VT102 control sequence to enable reversed video when flattened.
        r
   z[7mHello, world.N)r   r   r   r   reverseVideor   s    r   test_reverseVideoz$FormattedTextTests.test_reverseVideo4   s>    
 	&q~o'FGG"	
 	
 	
 	
 	
r   c           	          |                      t          j        t          j        t          j        dt          j        d          df                            d           dS )z
        Formatting attributes prefixed with a minus (C{-}) temporarily disable
        the prefixed attribute, emitting no VT102 control sequence to enable
        it in the flattened output.
        Helloz world.z[1;5mHello[0;5m world[1;5m.N)r   r   r   r   r   r   r   s    r   
test_minuszFormattedTextTests.test_minus>   s]     	&qww)9(93>?@  6		
 	
 	
 	
 	
r   c                     |                      t          j        t          j        t          j        j        d         t          j        j        d         f                   d           dS )z
        The foreground color formatting attribute, L{A.fg}, emits the VT102
        control sequence to set the selected foreground color when flattened.
        Hello, world!z[31mHello, [32mworld!N)r   r   r   r   r   fgredgreenr   s    r   test_foregroundz"FormattedTextTests.test_foregroundK   \    
 	&),adj.BBC  ,		
 	
 	
 	
 	
r   c                     |                      t          j        t          j        t          j        j        d         t          j        j        d         f                   d           dS )z
        The background color formatting attribute, L{A.bg}, emits the VT102
        control sequence to set the selected background color when flattened.
        r%   r&   z[41mHello, [42mworld!N)r   r   r   r   r   bgr(   r)   r   s    r   test_backgroundz"FormattedTextTests.test_backgroundW   r+   r   c                    |                      | j        g          }|                     t          |          d           t          j         |                      | j        g          }|                     t          |          d           |                     |d         d         t                     |                     |d         d         d           dS )zv
        L{twisted.conch.insults.text.flatten} emits a deprecation warning when
        imported or accessed.
        r      categorymessageztwisted.conch.insults.text.flatten was deprecated in Twisted 13.1.0: Use twisted.conch.insults.text.assembleFormattedText instead.N)flushWarningstest_flattenDeprecatedr   lenr   flattenDeprecationWarning)r   warningsShowns     r   r4   z)FormattedTextTests.test_flattenDeprecatedc   s    
 **D,G+HII]++Q/// 	**D,G+HII]++Q///q)*57IJJJ!Y'	
 	
 	
 	
 	
r   )r   N)__name__
__module____qualname____doc__r   r   r   r   r   r#   r*   r.   r4    r   r   r   r   
   s         
 
 
 

 
 
 

 
 
 

 
 
 

 
 
 

 
 
 


 

 

 



 

 

 


 
 
 
 
 
r   r   N)	twisted.conch.insultsr   twisted.conch.insults.textr   r   twisted.trialr   TestCaser   r=   r   r   <module>rB      s~   
 ' & & & & & 6 6 6 6 6 6 " " " " " "l
 l
 l
 l
 l
* l
 l
 l
 l
 l
r   