Your IP : 13.58.103.70


Current Path : /opt/alt/python34/lib64/python3.4/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/idlelib/idle_test/__pycache__/test_parenmatch.cpython-34.pyo

�
e f�
�@s�dZddlZddlmZddlmZddlmZmZddl	m
Z
Gdd�d�ZGd	d
�d
ej�Z
edkr�ejdd
�ndS)zTest idlelib.ParenMatch.�N)�Mock)�requires)�Tk�Text)�
ParenMatchc@seZdZdd�ZdS)�DummyEditwincCs(||_d|_d|_d|_dS)N�T)�textZindentwidthZtabwidthZcontext_use_ps1)�selfr	�r�F/opt/alt/python34/lib64/python3.4/idlelib/idle_test/test_parenmatch.py�__init__s			zDummyEditwin.__init__N)�__name__�
__module__�__qualname__r
rrrrrsrc@speZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�ParenMatchTestcCsMtd�t�|_t|j�|_t|j�|_t�|j_dS)NZgui)	rr�rootrr	r�editwinrZ
text_frame)�clsrrr�
setUpClasss

zParenMatchTest.setUpClasscCs#|`|`|jj�|`dS)N)r	rrZdestroy)rrrr�
tearDownClasss
zParenMatchTest.tearDownClasscCs|jjdd�dS)Nz1.0�end)r	Zdelete)r
rrr�tearDown#szParenMatchTest.tearDowncCs�|j}t|j�}|jd�|jdd�|jd�|jd|j��|j|j	dd�d
�|jdd
�|j
�|jd|j��|j|j	dd�f�|j
d�|j|j	dd�d�dS)z:
        Test ParenMatch with 'expression' style.
        Z
expression�insertzdef foobar(a, b�eventz<<parenmatch-check-restore>>�parenr�1.10�1.15�)�1.16N)rr)rr)r	rr�	set_styler�flash_paren_event�assertIn�
event_info�assertTupleEqual�
tag_prevrange�
restore_event�assertNotIn�assertEqual�paren_closed_event)r
r	�pmrrr�test_paren_expression&s	



z$ParenMatchTest.test_paren_expressioncCs�|j}t|j�}|jd�|jdd�|jd�|jd|j��|j|j	dd�d�|jdd
�|j
�|jd|j��|j|j	dd�f�dS)
z7
        Test ParenMatch with 'default' style.
        �defaultrzdef foobar(a, brz<<parenmatch-check-restore>>rr�1.10�1.11rN)r-r.)
r	rrr rr!r"r#r$r%r&r'r()r
r	r*rrr�test_paren_default=s	


z!ParenMatchTest.test_paren_defaultcCs�|j}t|j�}|jdd�|j|jd��|jdd�|j|jd��|j|jd��|jdd�|j|jd��dS)z�
        Test corner cases in flash_paren_event and paren_closed_event.

        These cases force conditional expression and alternate paths.
        rz# this is a commen)rz
defz	 a, *arg)N)r	rrrZassertIsNoner)r!)r
r	r*rrr�test_paren_cornerOs	z ParenMatchTest.test_paren_cornercCslt|j�}t�|_|jd�|j|jj�|jj�|jd�|j|jj�dS)Nr�)	rrrr&Zhandle_restore_timerZ
assertTrueZcalledZ
reset_mockZassertFalse)r
r*rrr�test_handle_restore_timerbs


z(ParenMatchTest.test_handle_restore_timerN)rrr�classmethodrrrr+r/r0r2rrrrrsr�__main__�	verbosity�)�__doc__ZunittestZ
unittest.mockrZtest.supportrZtkinterrrZidlelib.ParenMatchrrZTestCaserr�mainrrrr�<module>sY

?>