Your IP : 3.145.89.181


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/test_grep.cpython-36.pyc

3

� fd
�@s�dZddlmZddlZddlmZddlmZddlZGdd�d�Z	e	�Z
Gdd	�d	�Ze�ZGd
d�dej
�ZGdd
�d
ej
�ZGdd�dej
�Zedkr�ejdd�dS)a  !Changing this line will break Test_findfile.test_found!
Non-gui unit tests for grep.GrepDialog methods.
dummy_command calls grep_it calls findfiles.
An exception raised in one method will fail callers.
Otherwise, tests are mostly independent.
Currently only test grep_it, coverage 51%.
�)�
GrepDialogN)�captured_stdout)�Varc@seZdZdZdd�ZdS)�Dummy_searchenginez�GrepDialog.__init__ calls parent SearchDiabolBase which attaches the
    passed in SearchEngine instance as attribute 'engine'. Only a few of the
    many possible self.engine.x attributes are needed here.
    cCs|jS)N)�_pat)�self�r�@/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_grep.py�getpatszDummy_searchengine.getpatN)�__name__�
__module__�__qualname__�__doc__r
rrrr	rsrc@s,eZdZejZejZed�ZeZ	dd�Z
dS)�
Dummy_grepFcCsdS)Nr)rrrr	�close"szDummy_grep.closeN)rrr
r�grep_itZ	findfilesrZrecvar�searchengine�enginerrrrr	rs
rc@seZdZdS)�
FindfilesTestN)rrr
rrrr	r(src@s$eZdZdd�Zdd�Zdd�ZdS)�Grep_itTestc
CsF|tj_t��}tjtj|�t�WdQRX|j�j	d�}|j
�|S)N�
)�greprrrr�re�compile�__file__�getvalue�split�pop)r�pat�s�linesrrr	�report5szGrep_itTest.reportcCsFdd}|j|�}|jt|�d�|j||d�|j|dd�dS)Nzxyz*��r�zNo hits.)r!�assertEqual�len�assertIn)rrr rrr	�test_unfound=s

zGrep_itTest.test_unfoundcCsfd}|j|�}|jt|�d�|j||d�|jd|d�|jd|d�|j|djd	��dS)
Nz<""" !Changing this line will break Test_findfile.test_found!�rzpy: 1:r$�2��z(Hint:)r!r%r&r'Z
assertTrue�
startswith)rrr rrr	�
test_foundDs
zGrep_itTest.test_foundN)rrr
r!r(r.rrrr	r0src@seZdZdS)�Default_commandTestN)rrr
rrrr	r/Osr/�__main__r#)�	verbosity)rZidlelib.greprZunittestZtest.supportrZidlelib.idle_test.mock_tkrrrrrrZTestCaserrr/r�mainrrrr	�<module>s

?>