Your IP : 3.145.92.96
3
� 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� T)�textZindentwidthZtabwidthZcontext_use_ps1)�selfr � r �F/opt/alt/python36/lib64/python3.6/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 � | _| jj� 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$ | ` | `| jj� | jj� | `d S )N)r r r Zupdate_idletasksZdestroy)r r r r �
tearDownClass! s
zParenMatchTest.tearDownClassc C s | j jdd� 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>- s z/ParenMatchTest.get_parenmatch.<locals>.<lambda>)r r Zbell)r
�pmr r r �get_parenmatch+ s
zParenMatchTest.get_parenmatchc C s� | j }| j� }� x�d D ]�\}}}| j|d
��� |jdd� ||_|jd
d� |jd� | jd|j� � |dkr�| j |j
dd�d!� | j |jdd�|� |jd
d� |j� | j
d|j� � | j|jdd�f � |jd� | j |jdd�|� W dQ R X qW dS )"z2
Test ParenMatch with each style.
�opener�1.10�1.11�default�parens�1.14�1.15�1.16�
expression)�stylez1.0r �insertzdef foobar(a, b�eventz<<parenmatch-check-restore>>Zparen�)N�r r �r r �r r* r+ �r r �r r �r r- r. �r"