Your IP : 18.225.98.39


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_searchbase.cpython-36.pyc

3

� fg�@sxdZddlZddlmZddlmZmZddlmZ	ddlm
Zddlm
Z
Gdd	�d	ej�Zed
krtejddd�dS)
zTest searchbase, coverage 98%.�N)�requires)�Tk�Frame)�searchengine)�
searchbase)�Funcc@s�eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)�SearchDialogBaseTestcCstd�t�|_dS)NZgui)rr�root)�cls�r�F/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_searchbase.py�
setUpClassszSearchDialogBaseTest.setUpClasscCs|jj�|`dS)N)r	Zdestroy)r
rrr�
tearDownClass s
z"SearchDialogBaseTest.tearDownClasscCs&tj|j�|_tj|j|jd�|_dS)N)r	�engine)�seZSearchEnginer	r�sdbZSearchDialogBase�dialog)�selfrrr�setUp%szSearchDialogBaseTest.setUpcCs|jj�dS)N)r�close)rrrr�tearDown)szSearchDialogBaseTest.tearDowncCsxd|j_|jjd�|j|jjj�d�|jj�|j|jjj�d�|jjddd�|j|jjj�d�|jj�dS)N�textZnormalZ	withdrawn�hello)Zsearchphrase)	r�default_command�open�assertEqual�top�stater�ent�get)rrrr�test_open_and_close,s
z(SearchDialogBaseTest.test_open_and_closecCs~t�|j_t�|j_t�|j_t�|j_d|j_|jj�|j|jjj	�|j|jjj	�|j|jjj	�|j|jjj	�dS)N)
rr�create_entries�create_option_buttons�create_other_buttons�create_command_buttonsrZcreate_widgetsZ
assertTrueZcalled)rrrr�test_create_widgets;s




z(SearchDialogBaseTest.test_create_widgetscCs�|j}d|j_|j|j_|jjdd�\}}||dd�|j|j�d�|j�}|t	|d�d�|t	|d�d�|t	|d�d�|t	|d	�d�||jjd�dS)
NrzTest:rr�row�column�ZrowspanZ
columnspan)
rrr&r	rZ
make_entry�assertInrZ	grid_info�int)rZequal�entry�labelZegirrr�test_make_entryIs
z$SearchDialogBaseTest.test_make_entrycCs@|j|j_d|j_|jjd�|jj�|j|jjj	�d�dS)Nrr)
r	rrr&rZsetpatr!r)rr)rrrr�test_create_entriesXs


z(SearchDialogBaseTest.test_create_entriescCshd|j_|j|j_|jj�\}}|j|d�|j|t�|jjd�\}}|j|dd�|j|t�dS)Nr�Z	testlabelr)rr&r	rZ
make_framerZassertIsInstancer)r�framer,rrr�test_make_frame_s
z$SearchDialogBaseTest.test_make_framecCs|j|j_d|j_|�S)Nr)r	rrr&)r�methrrr�btn_test_setupjs
z#SearchDialogBaseTest.btn_test_setupc	Cs�|j}x�dD]�}x&|j|j|j|jfD]}|j|�q&W|j|jj�\}}xBt	||j
��D]0\}}|\}}|j|d|�|j|j�|�qZWqWdS)Nrr(r)rr()
rZrevarZcasevarZwordvarZwrapvar�setr3rr"�zip�pack_slavesrr)	r�er�varr0Zoptions�spec�buttonr,rrr�test_create_option_buttonsos
z/SearchDialogBaseTest.test_create_option_buttonsc
Cs�x�dD]x}|jj}|j|�|j|jj�\}}|j�}xFt||�D]8\}}|\}}	|j|d|	�||krB|j|j	�|�qBWqWdS)NFTr)FT)
rZbackvarr4r3rr#r6r5rr)
rrr8r0ZothersZbuttonsr9r:�valr,rrr�test_create_other_buttons{s

z.SearchDialogBaseTest.test_create_other_buttonscCs@|j|j_t|jj�|j_|jjd|jj�}|j|dd�dS)NZTestr)r	rrr�buttonframeZmake_buttonrr)rZbtnrrr�test_make_button�s
z%SearchDialogBaseTest.test_make_buttoncCsR|j|j_|jj�d}x(|jjj�D]}|ddkr&|d}q&W|jd|�dS)Nr/rrZcommand)r	rrr$r>Zwinfo_childrenr))rZclosebuttoncommandZchildrrr�test_create_command_buttons�s

z0SearchDialogBaseTest.test_create_command_buttonsN)�__name__�
__module__�__qualname__�classmethodr
rrrr r%r-r.r1r3r;r=r?r@rrrrrsr�__main__�)�	verbosity�exit)�__doc__ZunittestZtest.supportrZtkinterrrZidlelibrrrrZidlelib.idle_test.mock_idlerZTestCaserrA�mainrrrr�<module>s

?>