관리-도구
편집 파일: test_macosx.cpython-37.opt-1.pyc
B � f� � @ 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 �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_idletasks�destroyr 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)�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 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 � assertTrue�called� reset_mock)r Zmockinitr&