o
    /h                     @   s>   d Z ddlZddlZddlZddlmZ G dd dejZ	dS )z-Testcases for cssutils.stylesheets.MediaQuery    N   )basetestc                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )TestMediaQueryc                 C   s   t j | _d S )N)cssutilsstylesheets
MediaQueryr)self r
   R/var/www/html/myenv/lib/python3.10/site-packages/cssutils/tests/test_mediaquery.pysetup_method   s   zTestMediaQuery.setup_methodc                 C   s   i ddddddddddddddd	dd
dddddddddddddddddddddddd}| j |dd tjjtjjtjjtjjtjjd}| j|dd dS )zMediaQuery.mediaTextallNbrailleembossedhandheldprint
projectionscreenspeechttytvALLza\llznot tvzn\ot t\vzonly tvz	\only \tvPRINTprint and (color))z	NOT PRINTz
ONLY PRINTtv and (color)znot tv and (color)zonly tv and (color)zprint and(color)	mediaTextatt) z
two valueszor even threeaural3d_setMediaText)
do_equal_rxmldom	SyntaxErr
do_raise_rr	   testsr
   r
   r   test_mediaText   sd   	
zTestMediaQuery.test_mediaTextc                 C   s   t j }d|jksJ t jjjD ]}||_|j|ksJ | |_|j| ks+J qd}tt	j
j || W d   dS 1 sFw   Y  dS )zMediaQuery.mediaTyper   z3D-UNKOwn-MEDIAtype0123N)r   r   r   r   MEDIA_TYPES	mediaTypeupperpytestraisesr#   r$   r%   _setMediaType)r	   mqmtr
   r
   r   test_mediaType6   s   

"zTestMediaQuery.test_mediaTypec                 C   sv   i ddddddddddddddd	dd
ddddddddddddddd}| j |dd dS )zMediaQuery.mediaText commentsr   Nr   z	not printz
only printr   zprint and (color) and (width)zprint and (color: 2)zprint and (min-width: 100px)z-print and (min-width: 100px) and (color: red)z not print and (min-width: 100px)z!only print and (min-width: 100px)z/*1*/ tv /*2*/z/*0*/ only /*1*/ tv /*2*/z/*0* /not /*1*/ tv /*2*/zQ/*x*/ only /*x*/ print /*x*/ and /*x*/ (/*x*/ min-width /*x*/: /*x*/ 100px /*x*/)zprint and/*1*/(color)zprint and /*1*/ (color)r   r   )r"   r'   r
   r
   r   test_commentsH   sF   	
zTestMediaQuery.test_commentsc                 C   sP   d}t jj|d}|t|v sJ tt|}||jksJ t||js&J dS )z!MediaQuery.__repr__(), .__str__()r   )r   N)	r   r   r   strevalreprr   
isinstance	__class__)r	   r   ss2r
   r
   r   test_reprANDstr_   s   zTestMediaQuery.test_reprANDstrN)__name__
__module____qualname__r   r)   r2   r3   r;   r
   r
   r
   r   r      s    &r   )
__doc__xml.domr#   r-   cssutils.stylesheetsr   r   r   BaseTestCaser   r
   r
   r
   r   <module>   s    