B
Nj @ s d Z ddlmZ ddlZddlmZ ddlZddlm Z ddl
mZ dddhZd hZ
ee
B ZG d
d dejZG dd
d
ejZG dd dejZedkrejdd dS )z%Test macosx, coverage 45% on Windows. )macosxN)requires)FileListcarboncocoaxquartzotherc @ s0 e Zd ZdZedd Zedd Zdd ZdS ) InitTktypeTestzTest _init_tk_type.c C s( t d t | _| j tj| _d S )Ngui)r tkTkrootwithdrawr platform
orig_platform)cls r B/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_macosx.py
setUpClass s
zInitTktypeTest.setUpClassc C s$ | j | j | ` | jt_d S )N)r
update_idletasksdestroyr r r )r r r r
tearDownClass s
zInitTktypeTest.tearDownClassc
C s` xZdt fdtffD ]F\}}| j|d, |t_tjdk t | tj| W dQ R X qW dS )z<Test that _init_tk_type sets _tk_type according to platform.darwinr )r N)alltypesnontypessubTestr 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
ddd Zd d
Z
dS )IsTypeTkTestz*Test each of the four isTypeTk predecates.)r r r r r zidlelib.macosx._init_tk_typec
C sP dt _xD| jD ]:\}}| j|d | | |j | W dQ R X qW dS )zBTest that each isTypeTk calls _init_tk_type when _tk_type is None.N)func)r r isfuncsr
assertTruecalled
reset_mock)r Zmockinitr&