3 Õì2aí ã @ s¤ d dl mZ d dlZd dlmZ d dlZd dljZd dl m Z dddhZdhZeeB Z G d d „ d ejƒZG dd„ dejƒZG d d„ dejƒZedkr ejdd� dS )é )ÚmacosxN)Úrequires)ÚFileListÚcarbonÚcocoaÚxquartzÚotherc @ s, e Zd Zedd„ ƒZedd„ ƒZdd„ ZdS )ÚInitTktypeTestc C s( t dƒ tjƒ | _| jjƒ tj| _d S )NÚgui)r ÚtkÚTkÚrootÚwithdrawr ÚplatformÚ orig_platform)Úcls© r ú0/opt/alt/python36/lib64/python3.6/test_macosx.pyÚ setUpClass s zInitTktypeTest.setUpClassc C s$ | j jƒ | j jƒ | ` | jt_d S )N)r Úupdate_idletasksÚdestroyr r r )r r r r Ú tearDownClass s zInitTktypeTest.tearDownClassc C s` xZdt fdtffD ]F\}}| j|d��, |t_tjd k tjƒ | jtj|ƒ W d Q R X qW d S )NÚdarwinr )r )Ú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__Úclassmethodr r r r r r r r s r c @ sJ e Zd Zejd fejdfejdfejdffZe j dƒdd„ ƒZdd„ Zd S )ÚIsTypeTkTestr r r zidlelib.macosx._init_tk_typec C sP d t _xD| jD ]:\}}| j|d�� |ƒ | j|jƒ |jƒ W d Q R X qW d S )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 sb x\| j D ]R\}}xHtD ]@}| j|||d��& |t_||kr@| jn| j|ƒ ƒ W d Q R X qW qW d S )N)r% r* Útktype)r&