o
    wi                     @   s4   d dl Z d dlmZ ddlmZ G dd deZdS )    N)TestCase   )_indent_chunkc                   @   sD   e 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S )
TestIndentc              	   C   s   t dD ]A}t|d| }| D ]}| |dkp| t| q| j|d t||d}| 	|| W d    n1 s@w   Y  qd S )N     )indentation)indentation_length)
rangetextwrapindent
splitlines
assertTruestripreprsubTestr   assertEqual)selfchunkexpectedr	   expected_indentedlineresult r   [/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/Cython/Compiler/Tests/TestCode.py_test_indentations   s   zTestIndent._test_indentationsc                 C      |  dd d S )Nr   r   r   r   r   r   test_indent_empty      zTestIndent.test_indent_emptyc                 C   s@   |  dd |  dd |  dd |  dd |  dd d S )N
z

z


z 
 
z
  
 
    
z



r   r   r   r   r   test_indent_empty_lines   s
   z"TestIndent.test_indent_empty_linesc                 C   r   )Nabcr   r   r   r   r   test_indent_one_line   r!   zTestIndent.test_indent_one_linec                 C      d}d}|  || d S )Nz
            x = 1
            if x == 2:
                print("False")
            else:
                print("True")
        z=
x = 1
if x == 2:
    print("False")
else:
    print("True")
r   r   r   r   r   r   r   test_indent_chunk   s   zTestIndent.test_indent_chunkc                 C   r&   )N
            x = 1

            if x == 2:
                print("False")
            else:
                print("True")
        >
x = 1

if x == 2:
    print("False")
else:
    print("True")
r   r'   r   r   r   test_indent_empty_line0   s   z!TestIndent.test_indent_empty_linec                 C   s2   dj dd}d|d< d|}d}| || d S )Nr)   T)keependsz            
r   r   r*   )r   joinr   )r   linesr   r   r   r   r   test_indent_empty_line_uncleanC   s   
z)TestIndent.test_indent_empty_line_uncleanN)
__name__
__module____qualname__r   r    r#   r%   r(   r+   r/   r   r   r   r   r      s    r   )r   unittestr   Coder   r   r   r   r   r   <module>   s    