Your IP : 13.59.68.161


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/test_macosx.cpython-36.pyc

3

� f��@s�dZddlmZddlZddlmZddlZddlj	Z	ddl
mZdddhZd	hZ
ee
BZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�Zedkr�ejdd�dS)z%Test macosx, coverage 45% on Windows.�)�macosxN)�requires)�FileList�carbon�cocoa�xquartz�otherc@s0eZdZdZedd��Zedd��Zdd�ZdS)	�InitTktypeTestzTest _init_tk_type.cCs(td�tj�|_|jj�tj|_dS)N�gui)r�tk�Tk�root�withdrawr�platform�
orig_platform)�cls�r�B/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_macosx.py�
setUpClasss

zInitTktypeTest.setUpClasscCs$|jj�|jj�|`|jt_dS)N)r
�update_idletasks�destroyrrr)rrrr�
tearDownClasss

zInitTktypeTest.tearDownClasscCs`xZdtfdtffD]F\}}|j|d��,|t_tjdktj�|jtj|�WdQRXqWdS)z<Test that _init_tk_type sets _tk_type according to platform.�darwinr)rN)�alltypes�nontypes�subTestrr�_tk_typeZ
_init_tk_typeZassertIn)�selfr�typesrrr�test_init_sets_tktype s
z$InitTktypeTest.test_init_sets_tktypeN)�__name__�
__module__�__qualname__�__doc__�classmethodrrrrrrrr	sr	c@sNeZdZdZejdfejdfejdfejdffZ	e
jd�dd��Zdd	�Z
d
S)�IsTypeTkTestz*Test each of the four isTypeTk predecates.rrrzidlelib.macosx._init_tk_typec
CsPdt_xD|jD]:\}}|j|d�� |�|j|j�|j�WdQRXqWdS)zBTest that each isTypeTk calls _init_tk_type when _tk_type is None.N)�func)rr�isfuncsr�
assertTrue�called�
reset_mock)rZmockinitr&�whentruerrr�test_is_calls_init2szIsTypeTkTest.test_is_calls_initcCsbx\|jD]R\}}xHtD]@}|j|||d��&|t_||kr@|jn|j|��WdQRXqWqWdS)z,Test that each isTypeTk return correct bool.)r&r+�tktypeN)r'rrrrr(ZassertFalse)rr&r+r-rrr�test_isfuncs<s
zIsTypeTkTest.test_isfuncsN)rr)r r!r"r#rZisAquaTkZ
isCarbonTkZ	isCocoaTkZ	isXQuartzr'�mock�patchr,r.rrrrr%*s
r%c@s:eZdZdZedd��Zedd��Zejd�dd��Z	d	S)
�	SetupTestzTest setupApp.cs4td�tj�|_|jj��fdd���|j_dS)Nr
cs$t|t�st�t|t���s t�dS)N)�
isinstance�str�AssertionError�type)Ztkpathr&)�cmdrrr6Nsz!SetupTest.setUpClass.<locals>.cmd)rrrr
rZ
createcommand)rr)r6rrIs


zSetupTest.setUpClasscCs|jj�|jj�|`dS)N)r
rr)rrrrrSs

zSetupTest.tearDownClasszidlelib.macosx.overrideRootMenucCsf|j}t|�}xRtD]J}|j|d��4|t_tj||�|dkrL|j|j�|j	�WdQRXqWdS)z/Call setupApp with each possible graphics type.)r-rrN)rr)
r
rrrrrZsetupAppr(r)r*)rZoverrideRootMenur
Zflistr-rrr�
test_setupappYs
zSetupTest.test_setupappN)
r r!r"r#r$rrr/r0r7rrrrr1Fs
r1�__main__�)�	verbosity)r#ZidlelibrZunittestZtest.supportrZtkinterrZ
unittest.mockr/Zidlelib.filelistrZmactypesrrZTestCaser	r%r1r �mainrrrr�<module>s

!

?>