U
    +c
                     @   sj   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dZG dd	 d	ej	Z
ed
krfe  dS )zTests for formatting.py.    )absolute_import)division)print_function)
formatting)	testutilsP   c                   @   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S )FormattingTestc                 C   s   t d}| |ddg d S )Nhelloz[1mhello[0m)r   ZBoldassertInselftext r   8/tmp/pip-unpacked-wheel-1xt1w7un/fire/formatting_test.py	test_bold   s    
zFormattingTest.test_boldc                 C   s   t d}| |ddg d S )Nr	   z[4mhello[0m)r   Z	Underliner
   r   r   r   r   test_underline!   s    
zFormattingTest.test_underlinec                 C   s   t jddd}| d| d S )Nr	      spacesz  hellor   ZIndentassertEqualr   r   r   r   test_indent%   s    zFormattingTest.test_indentc                 C   s   t jddd}| d| d S )Nzhello
worldr   r   z  hello
  worldr   r   r   r   r   test_indent_multiple_lines)   s    z)FormattingTest.test_indent_multiple_linesc                 C   s   t dg}| dg| d S )Nricer   ZWrappedJoinr   r   linesr   r   r   test_wrap_one_item-   s    z!FormattingTest.test_wrap_one_itemc                 C   s,   t jddddgdd}| dddg| d S )	Nr   ZbeansZchickenZcheese   )widthzrice | beans |z	chicken |r   r   r   r   r   test_wrap_multiple_items1   s    z'FormattingTest.test_wrap_multiple_itemsc                 C   s$   d}t j|dtd}| d| d S )NThis is a string
   r   Zavailable_spaceZline_lengthz
This is...r   ZEllipsisTruncateLINE_LENGTHr   r   r   Ztruncated_textr   r   r   test_ellipsis_truncate8   s      z%FormattingTest.test_ellipsis_truncatec                 C   s$   d}t j|dtd}| d| d S )Nr!   r   r#   r$   r&   r   r   r   'test_ellipsis_truncate_not_enough_space>   s      z6FormattingTest.test_ellipsis_truncate_not_enough_spacec                 C   s$   d}t j|dtd}| d| d S )N1000000000L   r#   z10...0Lr   ZEllipsisMiddleTruncater%   r   r&   r   r   r   test_ellipsis_middle_truncateD   s      z,FormattingTest.test_ellipsis_middle_truncatec                 C   s$   d}t j|dtd}| d| d S )Nr)   r   r#   r+   r&   r   r   r   .test_ellipsis_middle_truncate_not_enough_spaceJ   s      z=FormattingTest.test_ellipsis_middle_truncate_not_enough_spaceN)__name__
__module____qualname__r   r   r   r   r   r    r'   r(   r,   r-   r   r   r   r   r      s   r   __main__N)__doc__
__future__r   r   r   Zfirer   r   r%   ZBaseTestCaser   r.   mainr   r   r   r   <module>   s   6