3
dk                 @   s@   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   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nz%!PS-Adobe-2.0z$
        --- |
          {}
        
)r   loadformatprintAssertionError)selfyamlsinpd r   X/var/www/html/virt/lib64/python3.6/site-packages/srsly/tests/ruamel_yaml/test_literal.py+test_root_literal_scalar_indent_example_9_5   s    z8TestNoIndent.test_root_literal_scalar_indent_example_9_5c             C   s:   t  }d}d}|j|j|}t| ||d ks6td S )N
testing123z"
        --- |
        {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   "test_root_literal_scalar_no_indent*   s    z/TestNoIndent.test_root_literal_scalar_no_indentc             C   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nr   z4
        %YAML 1.1
        --- |
        {}
        r   )r   r   r   r	   r
   )r   r   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}|||j|}t| ||d ksJtd S )Nr   )dedent)	safe_loadr   z6
        %YAML 1.1
        --- |
          {}
        r   )textwrapr   Zsrsly.ruamel_yamlr   r   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}|j|j| d S )NTr   zD
            %YAML 1.1
            --- |
            {}
            )r   Z1root_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   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nr   z$
        --- |1
         {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   *test_root_literal_scalar_indent_offset_one^   s    z7TestNoIndent.test_root_literal_scalar_indent_offset_onec             C   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nr   z'
        --- |4
            {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   +test_root_literal_scalar_indent_offset_fouri   s    z8TestNoIndent.test_root_literal_scalar_indent_offset_fourc             C   s@   t  }d}d}|j|j|d}t| ||d d ks<td S )Nz testing123z8
        --- |4
            {s}
            {s}
        )r   r      )r   r   r   r	   r
   )r   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   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nz%!PS-Adobe-2.0z"
        --- |
        {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   *test_root_literal_scalar_no_indent_special   s    z7TestNoIndent.test_root_literal_scalar_no_indent_specialc             C   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nz%!PS-Adobe-2.0z$
        --- >
          {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   test_root_folding_scalar_indent   s    z,TestNoIndent.test_root_folding_scalar_indentc             C   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nr   z"
        --- >
        {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   "test_root_folding_scalar_no_indent   s    z/TestNoIndent.test_root_folding_scalar_no_indentc             C   s:   t  }d}d}|j|j|}t| ||d ks6td S )Nz%!PS-Adobe-2.0z"
        --- >
        {}
        r   )r   r   r   r	   r
   )r   r   r   r   r   r   r   r   *test_root_folding_scalar_no_indent_special   s    z7TestNoIndent.test_root_folding_scalar_no_indent_specialc             C   s^   t ddd}d}d}d}x@t|j|j||D ]&\}}td| ddg| |ks0tq0W d S )	NsafeT)typZpureabcZklmz<
        --- |-
        {}
        --- |
        {}
        zd1:zklm
)r   	enumerateZload_allr   r	   r
   )r   r   s1s2r   idxZd1r   r   r   test_root_literal_multi_doc   s     
z(TestNoIndent.test_root_literal_multi_docc             C   s   t  }d|_d}|j| 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   s    z8TestNoIndent.test_root_literal_doc_indent_directives_endc             C   s   t  }d|_d}|j| d S )NTzI
        --- |-
          some more
          ...
          text
        )r   r+   r,   )r   r   r   r   r   r   )test_root_literal_doc_indent_document_end   s    z6TestNoIndent.test_root_literal_doc_indent_document_endc             C   s:   t  }d|_d}|j|}tt|t| |j| d S )NTz<
        --- |2
           some more
          text
        )r   r+   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   s:   t  }d|_d}|j|}tt|t| |j| d S )NTzG
        ---
        a: |2
           some more
          text
        )r   r+   r   r	   r/   r0   r,   )r   r   r   r   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"   r*   r-   r.   r1   r2   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   s:   t  }d|_d}d}|j|}|j|}|j||d d S )NTr   z"
        --- |
        {}
        )compare)r   r+   r   r   dump)r   r   r   ysr   r   r   r   %test_rt_root_literal_scalar_no_indent   s    

z;Test_RoundTripLiteral.test_rt_root_literal_scalar_no_indentc             C   s@   t  }d|_d|_d}d}|j|}|j|}|j||d d S )NT   r   z&
        --- |
            {}
        )r7   )r   r+   indentr   r   r8   )r   r   r   r9   r   r   r   r   "test_rt_root_literal_scalar_indent   s    

z8Test_RoundTripLiteral.test_rt_root_literal_scalar_indentc             C   s@   t  }d|_d|_d}d}|j|}|j|}|j||d d S )NTr   r   z 
        ---
        {}
        )r7   )r   r+   r<   r   r   r8   )r   r   r   r9   r   r   r   r   #test_rt_root_plain_scalar_no_indent  s    

z9Test_RoundTripLiteral.test_rt_root_plain_scalar_no_indentc             C   s@   t  }d|_d|_d}d}|j|}|j|}|j||d d S )NTr;   r   z$
        ---
            {}
        )r7   )r   r+   r<   r   r   r8   )r   r   r   r9   r   r   r   r   %test_rt_root_plain_scalar_expl_indent  s    

z;Test_RoundTripLiteral.test_rt_root_plain_scalar_expl_indentc             C   s@   t  }d|_d|_d}d}|j|}|j|}|j||d d S )NTr;   z'testing: 123'z$
        ---
            {}
        )r7   )r   r+   r<   r   r   r8   )r   r   r   r9   r   r   r   r   "test_rt_root_sq_scalar_expl_indent  s    

z8Test_RoundTripLiteral.test_rt_root_sq_scalar_expl_indentc             C   s@   t  }d|_d|_d}d}|j|}|j|}|j||d d S )NTr   z"'testing123"z 
        ---
        {}
        )r7   )r   r+   r<   r   r   r8   )r   r   r   r9   r   r   r   r   "test_rt_root_dq_scalar_expl_indent+  s    

z8Test_RoundTripLiteral.test_rt_root_dq_scalar_expl_indentc             C   s:   t  }d|_d}d}|j|}|j|}|j||d d S )NTr   z#
        --- |-
        {}
        )r7   )r   r+   r   r   r8   )r   r   r   r9   r   r   r   r   ,test_rt_root_literal_scalar_no_indent_no_eol:  s    

zBTest_RoundTripLiteral.test_rt_root_literal_scalar_no_indent_no_eolc             C   s4   t  }d}d}|j|}|j|}|j||d d S )Nr   z"
        - |
          {}
        )r7   )r   r   r   r8   )r   r   r   r9   r   r   r   r   test_rt_non_root_literal_scalarF  s    

z5Test_RoundTripLiteral.test_rt_non_root_literal_scalarN)r3   r4   r5   r:   r=   r>   r?   r@   rA   rB   rC   r   r   r   r   r6      s   r6   )
__future__r   ZpytestZ	roundtripr   r   r6   r   r   r   r   <module>   s
    M