3
Îéd#  ã               @   s*   d dl Z ddlmZmZ G dd„ dƒZdS )é    Né   )Ú
round_tripÚround_trip_load_allc               @   s<   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ ZdS )ÚTestDocumentc             C   s   d}t |ddd d S )Nz8        ---
        - a
        - b
        ...
        T)Úexplicit_startÚexplicit_end)r   )ÚselfÚinp© r
   úZ/var/www/html/virt/lib64/python3.6/site-packages/srsly/tests/ruamel_yaml/test_documents.pyÚtest_single_doc_begin_end	   s    z&TestDocument.test_single_doc_begin_endc             C   sT   ddl m}m} d}tt|ƒƒ}|dgdggks4t‚|||ddd}|dksPt‚d S )	Nr   )Údump_allÚRoundTripDumperzP        ---
        - a
        ...
        ---
        - b
        ...
        ÚaÚbT)ZDumperr   r   z---
- a
...
---
- b
...
)Úsrsly.ruamel_yamlr   r   Úlistr   ÚAssertionError)r   r   r   r	   ÚdocsÚoutr
   r
   r   Útest_multi_doc_begin_end   s    	z%TestDocument.test_multi_doc_begin_endc             C   s(   d}t t|ƒƒ}|dgdggks$t‚d S )NzD        - a
        ...
        ---
        - b
        ...
        r   r   )r   r   r   )r   r	   r   r
   r
   r   Útest_multi_doc_no_start$   s    z$TestDocument.test_multi_doc_no_startc             C   s(   d}t t|ƒƒ}|dgdggks$t‚d S )Nz,        - a
        ---
        - b
        r   r   )r   r   r   )r   r	   r   r
   r
   r   Útest_multi_doc_no_end/   s    z"TestDocument.test_multi_doc_no_endc             C   s,   d}t t|ddƒ}|dgdggks(t‚d S )Nz8        - a
        ...
        - b
        ...
        r   é   )Úversionr   r   )r   r   )r   r   r   )r   r	   r   r
   r
   r   Útest_multi_doc_ends_only8   s    z%TestDocument.test_multi_doc_ends_onlyc             C   sP   ddl m} tj|jƒ. d}tt|ddƒ}|dgdggksBt‚W d Q R X d S )	Nr   )ÚparserzL            - a
            ...
            - b
            ...
            r   )r   r   r   )r   r   )r   r   ÚpytestZraisesZParserErrorr   r   r   )r   r   r	   r   r
   r
   r   Útest_multi_doc_ends_only_1_1C   s
    z)TestDocument.test_multi_doc_ends_only_1_1N)	Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r
   r
   r
   r   r      s   		r   )r   Z	roundtripr   r   r   r
   r
   r
   r   Ú<module>   s   