o
    ;Di                     @   s   d dl mZmZmZ d dlZd dlmZ d dlZd dl	m
Z
mZmZ eeZej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 )    )absolute_importprint_functiondivisionN)eq_)lookseelookstrc                  C   "   d} t t| }d}t|| d S )Nfoobar)a   )b   zb+-----+-----+
| foo | bar |
+=====+=====+
| 'a' |   1 |
+-----+-----+
| 'b' |   2 |
+-----+-----+
reprr   r   tableactualexpect r   P/var/www/Datamplify/venv/lib/python3.10/site-packages/petl/test/util/test_vis.py	test_look      r   c                  C   r	   )N)r   )r   )r   r   Tz+-----+-----+------+
| foo | bar |      |
+=====+=====+======+
| 'a' |     |      |
+-----+-----+------+
| 'b' |   2 | True |
+-----+-----+------+
r   r   r   r   r   test_look_irregular_rows   r   r   c                  C   &   d} t t| dd}d}t|| d S )Nr
   Tindex_headerz~+-------+-------+
| 0|foo | 1|bar |
+=======+=======+
| 'a'   |     1 |
+-------+-------+
| 'b'   |     2 |
+-------+-------+
r   r   r   r   r   test_look_index_header.   s   r    c                  C   r	   )N)r   )r   T)r   Fzp+-----+-------+
| foo | bar   |
+=====+=======+
| 'a' | True  |
+-----+-------+
| 'b' | False |
+-----+-------+
r   r   r   r   r   test_look_bool=   r   r!   c                  C   sF   d} t t| dd}d}t|| t t| dtd}d}t|| d S )N)r   )abcdi  )bcdei)	     )truncatezb+-----+-----+
| foo | bar |
+=====+=====+
| 'ab | 123 |
+-----+-----+
| 'bc | 234 |
+-----+-----+
)r%   vreprzb+-----+-----+
| foo | bar |
+=====+=====+
| abc | 123 |
+-----+-----+
| bcd | 234 |
+-----+-----+
)r   r   r   strr   r   r   r   test_look_truncateL   s   
r(   c                  C   r   )Nr
   
   )widthzM+-----+---
| foo | ba
+=====+===
| 'a' |   
+-----+---
| 'b' |   
+-----+---
r   r   r   r   r   test_look_widthg   s   r+   c                  C   L   d} t t| dd}d}t|| dtj_t t| }t|| dtj_d S )Nr
   simplestylez6===  ===
foo  bar
===  ===
'a'    1
'b'    2
===  ===
gridr   r   r   etlconfig
look_styler   r   r   r   test_look_style_simpleu   s   

r5   c                  C   r,   )Nr
   minimalr.   zfoo  bar
'a'    1
'b'    2
r0   r1   r   r   r   r   test_look_style_minimal   s   

r7   c                  C   r	   )Nr
   zfoo: 'a', 'b'
bar: 1, 2
r   r   r   r   r   r   r   test_see   s   r9   c                  C   r   )Nr
   Tr   z0|foo: 'a', 'b'
1|bar: 1, 2
r8   r   r   r   r   test_see_index_header   s   r:   c                  C   r	   )N))r   r   r   )r   r   a_prime)r   r   b_primez2foo: 'a', 'b'
bar: 1, 2
foo: 'a_prime', 'b_prime'
r8   r   r   r   r   test_see_duplicateheader   s   r=   c                  C   r	   )Nr
   zb+-----+-----+
| foo | bar |
+=====+=====+
| a   |   1 |
+-----+-----+
| b   |   2 |
+-----+-----+
)r   r   r   r   r   r   r   test_lookstr   r   r>   c                  C   s"   g } t t| }d}t|| d S )N r   r   r   r   r   test_look_headerless   s   r@   )
__future__r   r   r   loggingpetl.test.helpersr   petlr2   petl.util.visr   r   r   	getLogger__name__loggerdebugr   r   r    r!   r(   r+   r5   r7   r9   r:   r=   r>   r@   r   r   r   r   <module>   s(    


