
    Pi"                        d dl Z d dlmZ d dlmZ d dlmZ d[dZd[dZ	e j
                            dg d          d             Ze j
                            d	g d
          d             Ze j
                            ddg dfdg dfdg dfdg dfdg dfg          d             Ze j
                            dddgfddgfddgfdd gfd!g d"fg          d#             Ze j
                            d$g d%          d&             Ze j
                            d'g d(          d)             Ze j
                            d*g d+          d,             Ze j
                            d-d.d/d0d1d2fd3d4d1d2fd5d6d7d1d2fd8d9d:d;d<d=d>d?g          e j
                            d@ddAg          dB                         Ze j
                            dCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWddXd1d2fdYg          dZ             ZdS )\    N)
CSSWarningCSSResolverc                 L    t                      } || |          }||k    sJ d S N	inheritedr   )csspropsr	   resolveactuals        t/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/tests/io/formats/test_css.pyassert_resolvesr   
   s0    mmGWSI...FF??????    c                 f    t                      } || |          } |||          }||k    sJ d S r   r   )css1css2r	   r   	resolved1	resolved2s         r   assert_same_resolutionr      sJ    mmG	222I	222I	!!!!!!r   zname,norm,abnorm))
whitespacehello: world; foo: barz( 	 hello 	 :
  world 
  ;  
 foo: 	bar

)caser   zHello: WORLD; foO: bar)z
empty-declr   z; hello: world;; foo: bar;
; ;)z
empty-list ;c                 &    t          ||           d S Nr   )namenormabnorms      r   test_css_parse_normalisationr"      s     4(((((r   zinvalid_css,remainder,msg))zhello-worldr   expected a colon)z border-style: solid; hello-worldzborder-style: solidr#   )z3border-style: solid; hello-world; font-weight: boldz&border-style: solid; font-weight: boldr#   )zfont-size: blahfont-size: 1emUnhandled size)zfont-size: 1a2br$   r%   )zfont-size: 1e5ptr$   r%   )zfont-size: 1+6ptr$   r%   )zfont-size: 1unknownunitr$   r%   )zfont-size: 10r$   r%   )zfont-size: 10 ptr$   r%   )zborder-top: 1pt solid red greenzborder-top: 1pt solid greenzToo manyc                     t          j        t          |          5  t          | |           d d d            d S # 1 swxY w Y   d S )Nmatch)tmassert_produces_warningr   r   )invalid_css	remaindermsgs      r   test_css_parse_invalidr.   (   s    2 
	#Jc	:	:	: 7 7{I6667 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7s   :>>zshorthand,expansionsmargin)z
margin-topzmargin-rightzmargin-bottomzmargin-leftpadding)zpadding-topzpadding-rightzpadding-bottomzpadding-leftzborder-width)zborder-top-widthzborder-right-widthzborder-bottom-widthborder-left-widthzborder-color)zborder-top-colorzborder-right-colorzborder-bottom-colorborder-left-colorzborder-style)zborder-top-stylezborder-right-stylezborder-bottom-styleborder-left-stylec                 z   |\  }}}}t          |  d|d|d|d|di           t          |  d|d|d|d|di           t          |  d|d|d|d|di           t          |  d|d|d|d|di           t          j        t          d	
          5  t          |  di            d d d            d S # 1 swxY w Y   d S )Nz: 1pt1ptz	: 1pt 4pt4ptz: 1pt 4pt 2pt2ptz: 1pt 4pt 2pt 0pt0ptzCould not expandr'   z: 1pt 1pt 1pt 1pt 1pt)r   r)   r*   r   )	shorthand
expansionstoprightbottomlefts         r   test_css_side_shorthandsr?   E   s   F  *Cc5%tUS   #ueUFE4QV!W   ###	eUE65$>  
 '''	eUE65$>  
 
	#J6H	I	I	I A A9;;;R@@@A A A A A A A A A A A A A A A A A As   B00B47B4zshorthand,sidesz
border-topr;   zborder-rightr<   zborder-bottomr=   zborder-leftr>   border)r;   r<   r=   r>   c           	      L    dd}t          |  d ||ddd                     d S )Nc                 V    i }| D ]#}|r	||d| d<   |r	||d| d<   |r	||d| d<   $|S )Nzborder-z-colorz-stylez-width )sidescolorstylewidthresolvedsides         r   create_border_dictz;test_css_border_shorthand_sides.<locals>.create_border_dict   sv     	9 	9D 938/4///0 938/4///0 938/4///0r   z: 1pt red solidredsolidr5   )NNNr   )r9   rD   rJ   s      r   test_css_border_shorthand_sidesrN      sU    	 	 	 	 %%%'9'9%QV'W'W    r   zprop, expected))z1pt red solidrK   rL   r5   )zred 1pt solidrO   )zred solid 1ptrO   )zsolid 1pt redrO   )z	red solid)rK   rL   
1.500000pt)z	1pt solid)blackrL   r5   )z1pt red)rK   noner5   )rK   )rK   rR   rP   )r5   )rQ   rR   r5   )rL   )rQ   rL   rP   )1em)rQ   rR   12ptc                 @    |\  }}}t          d|  |||d           d S )Nzborder-left: )r2   r3   r1   rM   )propexpectedrE   rF   rG   s        r   test_css_border_shorthandsrX      sJ    ( #E5%!&!&!&	
 	
    r   zstyle,inherited,equiv))zmargin: 1px; margin: 2pxr   margin: 2px)margin: 1pxrY   rZ   )zmargin: 1px; margin: inheritrY   rY   )margin: 1px; margin-top: 2pxr   zHmargin-left: 1px; margin-right: 1px; margin-bottom: 1px; margin-top: 2px)margin-top: 2pxrZ   r[   )rZ   r\   rZ   ) margin: 1px; margin-top: inheritrY   r[   c                 x    t                      } ||          } || |          } ||          }||k    sJ d S r   r   )rF   r	   equivr   inherited_propsstyle_propsequiv_propss          r   test_css_precedencerc      sT    * mmGgi((O'%?;;;K'%..K+%%%%%%r   zstyle,equiv))r]   z7margin-bottom: 1px; margin-right: 1px; margin-left: 1px)zmargin-top: inheritr   )zmargin-top: initialr   c                 &    t          | |           d S r   r   )rF   r_   s     r   test_css_none_absentre      s     5%(((((r   zsize,resolved)zxx-small6ptzx-smallg      @fptsmallg333333#@)mediumrT   largeg      +@)zx-large18pt)zxx-large24pt)8pxrf   )z1.25pc15pt)z.25inrl   )z02.54cm72pt)z25.4mmrp   )z101.6qrp   relative_to16ptc                 F    |d }nd|i}t          d|  d|i|           d S Nz	font-sizezfont-size: r   rM   sizerq   rH   r	   s       r   test_css_absolute_font_sizerw      sD    ( 		 +.	($((;*AYWWWWWWr   zsize,relative_to,resolved)rS   NrT   )1.0emNrT   )1.25emNro   )rS   rr   rr   )rx   rr   rr   )ry   rr   20pt)1remrr   rT   )z1.0remrr   rT   )z1.25remrr   ro   )100%NrT   )125%Nro   )r|   rr   rr   )r}   rr   rz   )2exNrT   )z2.0exNrT   )z2.50exNro   )inheritrr   rr   )smallerN10pt)r   rl   ro   largerg,@)r   ro   rl   c                 F    |d }nd|i}t          d|  d|i|           d S rt   rM   ru   s       r   test_css_relative_font_sizer     sD    6 		 +.	($((;*AYWWWWWWr   r   )pytestpandas.errorsr   pandas._testing_testingr)   pandas.io.formats.cssr   r   r   markparametrizer"   r.   r?   rN   rX   rc   re   rw   r   rC   r   r   <module>r      s    $ $ $ $ $ $       - - - - - -   " " " " 	 	 	 ) ) )    07 71 07
 	QQQR	VVVW  	
   	
   	
+! !DA AE! !DA2 	w	'#	8*%	!	5556	 	 	 	"    &
 
' &
    (& &) (&   
 
) )
 
) 	sLLLL!	S,,,,	T----  $ v77X X 87% &X  !" "#   #!#	4D'"+ 4X X5 4X X Xr   