Your IP : 216.73.216.213


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

a

XC?h��@s�ddlZddlZddlmZddlmZmZmZddlmZm	Z	ed�dZ
Gdd�deej�ZGd	d
�d
e	ej�Z
edkr�e��dS)�N)�font)�requires�
gc_collect�	ALWAYS_EQ)�AbstractTkTest�AbstractDefaultRootTestZguiZ
TkDefaultFontc@s`eZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dS)�FontTestcCsRtj�|�ztj|jtdd�|_Wn(tjyLtj|jtdd�|_Yn0dS)NT��root�name�existsF)	r�
setUpClass�__func__r�Fontr
�fontname�tkinter�TclError)�cls�r�H/opt/alt/python39/lib64/python3.9/tkinter/test/test_tkinter/test_font.pyr

s
zFontTest.setUpClasscCs�|j��}|�t|�hd��|D]2}|�|j�|�||�|�|j|||�q"dD]:}|�||t�|�|j�|�t�|�|j|t�qZ|jr�t	nt}dD]:}|�|||�|�|j�|�|�|�|j||�q�dS�N>�family�size�
overstrike�weight�	underline�slant)rrr)rrr)
rZ	configure�assertGreaterEqual�set�assertEqual�cget�assertIsInstance�str�wantobjects�int��selfZoptions�keyZsizetyperrr�test_configures 

�zFontTest.test_configurecCs`d}ztj|j|dd�}Wn&tjy@tj|j|dd�}Yn0|�|�d�|�~t�dS)NuMS ゴシックT)r
rrFr)rrr
rrrr r)r&r�frrr�test_unicode_family&szFontTest.test_unicode_familycCs�|j��}|�t|�hd��|D]}|�|j�|�||�q"dD](}|�||t�|�|j�|�t�qD|jrxtnt}dD](}|�|||�|�|j�|�|�q�dSr)	rZactualrrrr!r"r#r$r%rrr�test_actual0s

�zFontTest.test_actualcCs&|�|jjt�|�t|j�t�dS�N)rrrrr"�r&rrr�	test_name>szFontTest.test_namecCs�tj|jtdd�}tj|jtdd�}|�||�|�||�|�||���|�|d�|�|t�t	�
�}|�|j�tj|tdd�}|�t
|�t
|��|�||�dS)NTr	r)rrr
rZassertIsNotrZassertNotEqual�copyrr�TkZ
addCleanup�destroyr")r&Zfont1Zfont2Zroot2Zfont3rrr�
test_equalityBszFontTest.test_equalitycCs|�|j�d�t�dS)N�abc)r!rZmeasurer$r-rrr�test_measureRszFontTest.test_measurecCsh|j��}|�t|�hd��|D]@}|�|j�|�||�|�||t�|�|j�|�t�q"dS)N>ZfixedZ	linespaceZascentZdescent)r�metricsrrrr!r$)r&r5r'rrr�test_metricsUs

�zFontTest.test_metricscCsFt�|j�}|�|t�|�|�|D]}|�|t�|�|�q&dSr,)r�familiesr
r!�tuple�
assertTruer")r&r7rrrr�
test_families^s
zFontTest.test_familiescCsRt�|j�}|�|t�|�|�|D]}|�|t�|�|�q&|�t|�dSr,)	r�namesr
r!r8r9r"�assertInr)r&r;rrrr�
test_namesfs
zFontTest.test_namesN)�__name__�
__module__�__qualname__�classmethodr
r(r*r+r.r2r4r6r:r=rrrrrs

	rc@seZdZdd�Zdd�ZdS)�DefaultRootTestcCsv|�ttj�t��}t��}|�|t�|�|�|D]}|�|t	�|�|�q8|�
�t��|�ttj�dSr,)�assertRaises�RuntimeErrorrr7rr0r!r8r9r"r1�
NoDefaultRoot)r&r
r7rrrrr:rs
zDefaultRootTest.test_familiescCs�|�ttj�t��}t��}|�|t�|�|�|D]}|�|t	�|�|�q8|�
t|�|��t�
�|�ttj�dSr,)rCrDrr;rr0r!r8r9r"r<rr1rE)r&r
r;rrrrr=s
zDefaultRootTest.test_namesN)r>r?r@r:r=rrrrrBps
rB�__main__)ZunittestrrZtest.supportrrrZtkinter.test.supportrrrZTestCaserrBr>�mainrrrr�<module>se