Your IP : 216.73.216.213


Current Path : /opt/alt/python39/lib64/python3.9/tkinter/test/test_ttk/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/tkinter/test/test_ttk/__pycache__/test_style.cpython-39.pyc

a

XC?h��@s�ddlZddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
ed�gd�ZGdd	�d	e	ej�Z
ed
kr�e��dS)�N)�ttk)�support)�requires)�AbstractTkTest�get_tk_patchlevelZgui)�.ZComboboxPopdownFrameZHeadingzHorizontal.TProgressbarzHorizontal.TScaleZItemZSash�TButtonZTCheckbuttonZ	TComboboxZTEntryZTLabelframezTLabelframe.LabelZTMenubuttonZ	TNotebookz
TNotebook.TabZ
ToolbuttonZTProgressbarZTRadiobutton�TreeviewZTScaleZ
TScrollbarZTSpinboxzVertical.TProgressbarzVertical.TScalecsTeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�	StyleTestcst���t�|j�|_dS)N)�super�setUprZStyle�root�style)�self��	__class__��E/opt/alt/python39/lib64/python3.9/tkinter/test/test_ttk/test_style.pyrs
zStyleTest.setUpcCs>|j}|jddd�|�|�dd�d�|�|�d�t�dS)Nr�yellow��
backgroundr)r�	configure�assertEqual�assertIsInstance�dict�rrrrr�test_configures�zStyleTest.test_configurec	Cs�|j}dgdgfD]�}|j|d��j|jdg|�d�Rgd�dg}|�|�dd�|�|�d�}|�|t�|�|d|�Wd�q1s�0Yqd	d
gdgdgfD]�}|j|d��j|jdg|�d
�Rgd�dg}|�|�dd�|�|�d�}|�|t�|�|d|�Wd�q�1�s20Yq�gdgdgfD]�}|j|d��j|jdg|�d�Rgd�dg}|�|�dd�|�|�d�}|�|t�|�|d|�Wd�n1�s�0Y�qLdS)N�active)r)�statesr�whiter)rrr�pressed�	!disabledzpressed !disabled)r r!�black)r r!r"�r�grey)r$)r�subTest�maprrr)rrrZexpected�mrrr�test_map$s2
0
2
zStyleTest.test_mapcCsn|j}|jddd�|jddgd�|�|�dd�d�|�|�ddddg�d�|�|jddd	d
�d	�dS)Nrrr)rr�bluerrr)ZoptionnotdefinedZiknewit)�default)rrr&r�lookuprrrr�test_lookupFs����zStyleTest.test_lookupcCs�|j}|�tj|jd�|�d�}|�dd�|�|�d�dddifg�|�d|�|�|�d�|�|�|�d�t�|�tj|jddd	d
ifg�dS)NZ
NotALayoutr	r#ZnullZstickyZnswer�nameZoptionZ
inexistent)r�assertRaises�tkinter�TclErrorZlayoutrr�list)rrZtv_stylerrr�test_layoutRs
��zStyleTest.test_layoutcCs�|�tj|jjd�|j��}d}|j��D] }||kr,|}|j�|�qRq,dS|�||k�|�||j��k�|j�|�dS)NZnonexistingname)r.r/r0r�	theme_use�theme_namesZassertFalse)r�
curr_themeZ	new_theme�themerrr�test_theme_useis�
zStyleTest.test_theme_usec	
Cs4|j}|j��}|�|jj|�|j��D�]}|j�|�tD]�}|�|�}|sTq@|j||d���tjdkr|t	d|||�|dvr�t
��dd�dkr�Wd�q@d|��}|�|�|�d�|j|fi|��|�|�|�|�|�
�D]\}}|�|�||�|�q�Wd�q@1�s"0Yq@q*dS)N�r6r-�r�ZvistaZxpnative����C.)rr3�
addCleanupr4�CLASS_NAMESrr%r�verbose�print�sys�getwindowsversionr�items�	rrr5r6r-r*Znewname�key�valuerrr�test_configure_custom_copy~s,


�
z$StyleTest.test_configure_custom_copyc	
Cs\|j}|j��}|�|jj|�|j��D�]*}|j�|�tD�]}|�|�}|sVq@|j||d���tjdkr~t	d|||�|dvr�t
��dd�dkr�Wd�q@d|��}|�|�|�i�|j|fi|��|dkr�|dkr�t
�d	kr�d
g|d<|�|�|�|�|��D]\}}|�|�||�|��qWd�q@1�sJ0Yq@q*dS)Nr8r9r&r:r;r>Zaltr)�r<r=)Zdisabled�1Zembossed)rr3r?r4r@r&r%rrArBrCrDrrrErFrrr�test_map_custom_copy�s0



�

zStyleTest.test_map_custom_copy)�__name__�
__module__�__qualname__rrr(r,r2r7rIrL�
__classcell__rrrrr
s"r
�__main__)ZunittestrCr/r�testrZtest.supportrZtkinter.test.supportrrr@ZTestCaser
rM�mainrrrr�<module>s