File: //opt/python38/lib/python3.8/idlelib/idle_test/__pycache__/test_macosx.cpython-38.pyc
U
�i�_� � @ s� d Z ddlmZ ddlZddlmZ ddlZddlm Z ddl
mZ dddhZd hZ
ee
B ZG d
d� dej�ZG dd
� d
ej�ZG dd� dej�Zedkr�ejdd� dS )z%Test macosx, coverage 45% on Windows.� )�macosxN)�requires)�FileList�carbon�cocoa�xquartz�otherc @ s0 e Zd ZdZedd� �Zedd� �Zdd� ZdS ) �InitTktypeTestzTest _init_tk_type.c C s( t d� t�� | _| j�� tj| _d S )N�gui)r �tk�Tk�root�withdrawr �platform�
orig_platform��cls� r �</opt/python38/lib/python3.8/idlelib/idle_test/test_macosx.py�
setUpClass s
zInitTktypeTest.setUpClassc C s$ | j �� | j �� | ` | jt_d S �N)r
�update_idletasks�destroyr r r r r r r �
tearDownClass s
zInitTktypeTest.tearDownClassc
C s\ dt fdtffD ]F\}}| j|d��, |t_tjdk t�� | �tj|� W 5 Q R X qdS )z<Test that _init_tk_type sets _tk_type according to platform.�darwinr )r N)�alltypes�nontypes�subTestr r �_tk_typeZ
_init_tk_typeZassertIn)�selfr �typesr r r �test_init_sets_tktype s
z$InitTktypeTest.test_init_sets_tktypeN)�__name__�
__module__�__qualname__�__doc__�classmethodr r r! r r r r r s
r c @ sN e Zd ZdZejdfejdfejdfejdffZ e
�d�dd� �Zd d
� Z
dS )�IsTypeTkTestz*Test each of the four isTypeTk predecates.�r r r r r zidlelib.macosx._init_tk_typec
C sL dt _| jD ]:\}}| j|d�� |� | �|j� |�� W 5 Q R X qdS )zBTest that each isTypeTk calls _init_tk_type when _tk_type is None.N)�func)r r �isfuncsr �
assertTrue�called�
reset_mock)r Zmockinitr) �whentruer r r �test_is_calls_init2 s zIsTypeTkTest.test_is_calls_initc C sZ | j D ]N\}}tD ]@}| j|||d��& |t_||kr<| jn| j|� � W 5 Q R X qqdS )z,Test that each isTypeTk return correct bool.)r) r. �tktypeN)r* r r r r r+ ZassertFalse)r r) r. r0 r r r �test_isfuncs<