o
    
ik                     @   sB   d dl mZ d dlZddlmZ 	 G dd dZG dd dZdS )	    )print_functionN   )YAMLc                   @   s   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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 )$TestNoIndentc                 C   :   t  }d}d}|||}t| ||d ksJ d S )N%!PS-Adobe-2.0z$
        --- |
          {}
        
r   loadformatprintselfyamlsinpd r   X/home/ubuntu/.local/lib/python3.10/site-packages/srsly/tests/ruamel_yaml/test_literal.py+test_root_literal_scalar_indent_example_9_5      z8TestNoIndent.test_root_literal_scalar_indent_example_9_5c                 C   r   )N
testing123"
        --- |
        {}
        r   r	   r   r   r   r   "test_root_literal_scalar_no_indent*   r   z/TestNoIndent.test_root_literal_scalar_no_indentc                 C   r   )Nr   z4
        %YAML 1.1
        --- |
        {}
        r   r	   r   r   r   r   &test_root_literal_scalar_no_indent_1_15   s   z3TestNoIndent.test_root_literal_scalar_no_indent_1_1c                 C   sN   ddl m} ddlm} d}d}||||}t| ||d ks%J d S )Nr   )dedent)	safe_loadr   z6
        %YAML 1.1
        --- |
          {}
        r   )textwrapr   srsly.ruamel_yamlr   r   r   )r   r   r   r   r   r   r   r   r   0test_root_literal_scalar_no_indent_1_1_old_styleA   s   z=TestNoIndent.test_root_literal_scalar_no_indent_1_1_old_stylec                 C   s*   t  }d|_d}	 d}||| d S )NTr   zD
            %YAML 1.1
            --- |
            {}
            )r   1root_level_block_style_scalar_no_indent_error_1_1r
   r   )r   r   r   r   r   r   r   /test_root_literal_scalar_no_indent_1_1_no_raiseO   s   z<TestNoIndent.test_root_literal_scalar_no_indent_1_1_no_raisec                 C   r   )Nr   z$
        --- |1
         {}
        r   r	   r   r   r   r   *test_root_literal_scalar_indent_offset_one^   r   z7TestNoIndent.test_root_literal_scalar_indent_offset_onec                 C   r   )Nr   z'
        --- |4
            {}
        r   r	   r   r   r   r   +test_root_literal_scalar_indent_offset_fouri   r   z8TestNoIndent.test_root_literal_scalar_indent_offset_fourc                 C   s@   t  }d}d}||j|d}t| ||d d ksJ d S )Nz testing123z8
        --- |4
            {s}
            {s}
        )r   r      r	   r   r   r   r   8test_root_literal_scalar_indent_offset_two_leading_spacet   s   zETestNoIndent.test_root_literal_scalar_indent_offset_two_leading_spacec                 C   r   )Nr   r   r   r	   r   r   r   r   *test_root_literal_scalar_no_indent_special   r   z7TestNoIndent.test_root_literal_scalar_no_indent_specialc                 C   r   )Nr   z$
        --- >
          {}
        r   r	   r   r   r   r   test_root_folding_scalar_indent   r   z,TestNoIndent.test_root_folding_scalar_indentc                 C   r   )Nr   "
        --- >
        {}
        r   r	   r   r   r   r   "test_root_folding_scalar_no_indent   r   z/TestNoIndent.test_root_folding_scalar_no_indentc                 C   r   )Nr   r(   r   r	   r   r   r   r   *test_root_folding_scalar_no_indent_special   r   z7TestNoIndent.test_root_folding_scalar_no_indent_specialc                 C   sZ   t ddd}d}d}d}t||||D ]\}}td| ddg| |ks*J qd S )	NsafeT)typpureabcklmz<
        --- |-
        {}
        --- |
        {}
        zd1:zklm
)r   	enumerateload_allr   r   )r   r   s1s2r   idxd1r   r   r   test_root_literal_multi_doc   s   
z(TestNoIndent.test_root_literal_multi_docc                 C      t  }d|_d}|| d S )NTzT
        --- |-
          %YAML 1.3
          ---
          this: is a test
        r   explicit_start
round_tripr   r   r   r   r   r   +test_root_literal_doc_indent_directives_end      z8TestNoIndent.test_root_literal_doc_indent_directives_endc                 C   r7   )NTzI
        --- |-
          some more
          ...
          text
        r8   r;   r   r   r   )test_root_literal_doc_indent_document_end   r=   z6TestNoIndent.test_root_literal_doc_indent_document_endc                 C   :   t  }d|_d}||}tt|t| || d S )NTz<
        --- |2
           some more
          text
        r   r9   r
   r   typereprr:   r   r   r   r   r   r   r   #test_root_literal_doc_indent_marker   s   
z0TestNoIndent.test_root_literal_doc_indent_markerc                 C   r?   )NTzG
        ---
        a: |2
           some more
          text
        r@   rC   r   r   r   %test_nested_literal_doc_indent_marker   s   
z2TestNoIndent.test_nested_literal_doc_indent_markerN)__name__
__module____qualname__r   r   r   r   r!   r"   r#   r%   r&   r'   r)   r*   r6   r<   r>   rD   rE   r   r   r   r   r      s$    r   c                   @   sL   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d Z
dS )Test_RoundTripLiteralc                 C   :   t  }d|_d}d}||}||}|j||d d S )NTr   r   comparer   r9   r   r
   dumpr   r   r   ysr   r   r   r   %test_rt_root_literal_scalar_no_indent      

z;Test_RoundTripLiteral.test_rt_root_literal_scalar_no_indentc                 C   @   t  }d|_d|_d}d}||}||}|j||d d S )NT   r   z&
        --- |
            {}
        rK   r   r9   indentr   r
   rN   rO   r   r   r   "test_rt_root_literal_scalar_indent      

z8Test_RoundTripLiteral.test_rt_root_literal_scalar_indentc                 C   rS   )NTr   r    
        ---
        {}
        rK   rU   rO   r   r   r   #test_rt_root_plain_scalar_no_indent  rX   z9Test_RoundTripLiteral.test_rt_root_plain_scalar_no_indentc                 C   rS   )NTrT   r   $
        ---
            {}
        rK   rU   rO   r   r   r   %test_rt_root_plain_scalar_expl_indent  rX   z;Test_RoundTripLiteral.test_rt_root_plain_scalar_expl_indentc                 C   rS   )NTrT   z'testing: 123'r[   rK   rU   rO   r   r   r   "test_rt_root_sq_scalar_expl_indent  rX   z8Test_RoundTripLiteral.test_rt_root_sq_scalar_expl_indentc                 C   rS   )NTr   z"'testing123"rY   rK   rU   rO   r   r   r   "test_rt_root_dq_scalar_expl_indent+  s   

z8Test_RoundTripLiteral.test_rt_root_dq_scalar_expl_indentc                 C   rJ   )NTr   z#
        --- |-
        {}
        rK   rM   rO   r   r   r   ,test_rt_root_literal_scalar_no_indent_no_eol:  rR   zBTest_RoundTripLiteral.test_rt_root_literal_scalar_no_indent_no_eolc                 C   s4   t  }d}d}||}||}|j||d d S )Nr   z"
        - |
          {}
        rK   )r   r   r
   rN   rO   r   r   r   test_rt_non_root_literal_scalarF  s   

z5Test_RoundTripLiteral.test_rt_non_root_literal_scalarN)rF   rG   rH   rQ   rW   rZ   r\   r]   r^   r_   r`   r   r   r   r   rI      s    rI   )
__future__r   pytest	roundtripr   r   rI   r   r   r   r   <module>   s    M