관리-도구
편집 파일: test_parenmatch.cpython-37.pyc
B � f� � @ s� d Z ddlmZ ddlmZ ed� ddlZddlmZ ddlm Z m Z G dd � d �ZG d d� dej�Z edkr|ejd d� dS )z�Test parenmatch, coverage 91%. This must currently be a gui test because ParenMatch methods use several text methods not defined on idlelib.idle_test.mock_tk.Text. � )� ParenMatch)�requiresZguiN)�Mock)�Tk�Textc @ s e Zd Zdd� ZdS )�DummyEditwinc C s || _ d| _d| _d| _d S )N� z>>>)�textZindentwidthZtabwidthZprompt_last_line)�selfr � r �F/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_parenmatch.py�__init__ s zDummyEditwin.__init__N)�__name__� __module__�__qualname__r r r r r r s r c @ sL e Zd Zedd� �Zedd� �Zdd� Zdd� Zd d � Zdd� Z d d� Z dS )�ParenMatchTestc C s8 t � | _| j�� t| j�| _t| j�| _t� | j_d S )N) r �rootZwithdrawr r r �editwinr Z text_frame)�clsr r r � setUpClass s zParenMatchTest.setUpClassc C s$ | ` | `| j�� | j�� | `d S )N)r r r Zupdate_idletasksZdestroy)r r r r � tearDownClass! s zParenMatchTest.tearDownClassc C s | j �dd� d S )Nz1.0�end)r �delete)r r r r �tearDown( s zParenMatchTest.tearDownc C s t | j�}dd� |_|S )Nc S s d S )Nr r r r r �<lambda>- � z/ParenMatchTest.get_parenmatch.<locals>.<lambda>)r r Zbell)r �pmr r r �get_parenmatch+ s zParenMatchTest.get_parenmatchc C s� | j }| �� }x�dD ]�\}}}| j|d��� |�dd� ||_|�dd� |�d� | �d|�� � |d kr�| � |� d d�d� | � |�d d�|� |�dd� |�� | � d|�� � | �|�d d�d � |�d� | � |�d d�|� W dQ R X qW dS )z2 Test ParenMatch with each style. ))�opener)z1.10z1.11)z1.10z1.11)�default)z1.10z1.11)z1.10z1.11)�parens)z1.14z1.15)z1.15z1.16)Z expression)z1.10z1.15)z1.10z1.16)�stylez1.0r �insertzdef foobar(a, b�eventz<<parenmatch-check-restore>>r Zparen)z1.10z1.11�)r N)r r ZsubTestr ZSTYLEr"