관리-도구
편집 파일: test_macosx.cpython-36.opt-1.pyc
3 � f� � @ s� d Z ddlmZ ddlZddlmZ ddlZddlj 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� tj� | _| jj� tj| _d S )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� 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_tjdk tj� | jtj|� W dQ R X qW dS )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 jd�dd� �Zdd � Z d S )�IsTypeTkTestz*Test each of the four isTypeTk predecates.r r r zidlelib.macosx._init_tk_typec C sP dt _xD| jD ]:\}}| j|d�� |� | j|j� |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 � assertTrue�called� reset_mock)r Zmockinitr&