o
    ;Di)                     @   sd   d dl mZmZmZ d dlmZ d dlZd dlmZ d dl	m
Z
 dd Zdd	 Zd
d Zdd ZdS )    )absolute_importprint_functiondivision)NamedTemporaryFileN)eq_)tohtmlc                  C   sp   d} t dd}t| |jddd tj|jdddd	}| }d
}t|| W d    d S 1 s1w   Y  d S )N)foobara   b)r      )cFFdeleteascii
encodinglineterminatorrt moder   newlinez<table class='petl'>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td style='text-align: right'>1</td>
</tr>
<tr>
<td>b</td>
<td>(1, 2)</td>
</tr>
<tr>
<td>c</td>
<td>False</td>
</tr>
</tbody>
</table>
r   r   nameioopenreadr   tablefoactualexpect r)   O/var/www/Datamplify/venv/lib/python3.10/site-packages/petl/test/io/test_html.pytest_tohtml   s   
"r+   c                  C   sr   d} t dd}t| |jdddd tj|jddd	d
}| }d}t|| W d    d S 1 s2w   Y  d S )N)r   r   r   Fr   r   zmy tabler   )r   captionr   r   r   r   z<table class='petl'>
<caption>my table</caption>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td style='text-align: right'>1</td>
</tr>
<tr>
<td>b</td>
<td>(1, 2)</td>
</tr>
</tbody>
</table>
r   r#   r)   r)   r*   test_tohtml_caption6   s   
"r-   c                  C   st   d} t dd}t| |jddddd tj|jd	dd
d}| }d}t|| W d    d S 1 s3w   Y  d S )N)r   r   Fr   r   r   ztext-align: rightztext-align: center)r   r   tr_style	td_stylesr   r   r   z<table class='petl'>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
</tr>
</thead>
<tbody>
<tr style='text-align: right'>
<td style='text-align: center'>a</td>
<td style='text-align: center'>1</td>
</tr>
</tbody>
</table>
r   r#   r)   r)   r*   test_tohtml_with_style[   s   
"r0   c                  C   sp   g } t dd}t| |jddd tj|jdddd}| }d	}t|| W d    d S 1 s1w   Y  d S )
NFr   r   r   r   r   r   r   z/<table class='petl'>
<tbody>
</tbody>
</table>
r   r#   r)   r)   r*   test_tohtml_headerless{   s   
"r1   )
__future__r   r   r   tempfiler   r    petl.test.helpersr   petl.io.htmlr   r+   r-   r0   r1   r)   r)   r)   r*   <module>   s   )% 