
>\                 @   s   d  d l  Z  d  d l m Z d  d l Z d d l m Z e  j d  d k rZ d d   Z n d d   Z Gd	 d
   d
 e  Z d S)    N)TestCase   )from_this_dir   c             C   s   |  S)N )sr   r   :/home/travis/build/python-excel/xlrd/tests/test_formats.pyu   s    r	   c             C   s   |  j  d  S)Nzutf-8)decode)r   r   r   r   r	      s    c               @   sp   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)TestCellContentc             C   s=   t  j t d  d d |  _ |  j j t d   |  _ d  S)NzFormate.xlsformatting_infoTu   Blätt1)xlrdopen_workbookr   booksheet_by_namer	   sheet)selfr   r   r   setUp   s    zTestCellContent.setUpc             C   s   x t  t d  t d  t d  g  D]c \ } } |  j j | d  } |  j | j t j j  |  j | j	 |  |  j
 | j d k  q( Wd  S)NZHuberu   Äckeru   Öckerr   )	enumerater	   r   cellassertEqualctyper   r   XL_CELL_TEXTvalue
assertTruexf_index)r   rownamer   r   r   r   test_text_cells   s
    4zTestCellContent.test_text_cellsc             C   s{   xt d d d	 g D]c \ } } |  j  j | d  } |  j | j t j j  |  j | j |  |  j | j	 d k  q Wd  S)
Nr        j@r       @       @)r   r   )r   r    )r!   r"   )
r   r   r   r   r   r   XL_CELL_DATEr   r   r   )r   r   dater   r   r   r   test_date_cells   s
    zTestCellContent.test_date_cellsc             C   s   xz d d d g D]i \ } } |  j  j | d  } |  j | j t j j  |  j | j | d d	 |  j	 | j
 d
 k  q Wd  S)Nr   4ׂ?   疒$>?   pG?r   places   r   )r   r&   )r'   r(   )r)   r*   )r   r   r   r   r   r   r#   assertAlmostEqualr   r   r   )r   r   timer   r   r   r   test_time_cells)   s
    zTestCellContent.test_time_cellsc             C   s~   xw d	 d
 g D]i \ } } |  j  j | d  } |  j | j t j j  |  j | j | d d |  j	 | j
 d k  q Wd  S)Nr,   ^I+?   X9v?r   r+   r   r   )r,   r0   )r1   r2   )r   r   r   r   r   r   XL_CELL_NUMBERr-   r   r   r   )r   r   r.   r   r   r   r   test_percent_cells3   s
    z"TestCellContent.test_percent_cellsc             C   s~   xw d	 d
 g D]i \ } } |  j  j | d  } |  j | j t j j  |  j | j | d d |  j	 | j
 d k  q Wd  S)N   fffffB@	   333333?r   r+   r!   r   )r5   r6   )r7   r8   )r   r   r   r   r   r   r3   r-   r   r   r   )r   r   r.   r   r   r   r   test_currency_cells:   s
    z#TestCellContent.test_currency_cellsc             C   sp   |  j  j t d   } | j d d  } |  j | j t j  j  |  j | j d  |  j	 | j
 d k  d  S)Nu   ÖÄÜr!   zMERGED CELLSr   )r   r   r	   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   test_get_from_merged_cellA   s
    z)TestCellContent.test_get_from_merged_cellc             C   sp   |  j  j t d   } | j d d  } |  j | j t j  j  |  j | j d  |  j	 | j
 d k  d  S)Nu   Blätt3r   d   )r   r   r	   r   r   r   r   r3   r   r   r   )r   r   r   r   r   r   test_ignore_diagramH   s
    z#TestCellContent.test_ignore_diagramN)__name__
__module____qualname__r   r   r%   r/   r4   r9   r:   r<   r   r   r   r   r      s   

r   )	sysunittestr   r   baser   version_infor	   r   r   r   r   r   <module>   s   