HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/idlelib/idle_test/__pycache__/test_searchbase.cpython-38.pyc
U

�i�_�@s�dZddlZddlmZddlmZmZmZddlm	Z	ddl
mZddl
m
ZddlmZGd	d
�d
ej�Zedkr�ejddd
�dS)zTest searchbase, coverage 98%.�N)�requires)�Text�Tk�Toplevel)�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�@/opt/python38/lib/python3.8/idlelib/idle_test/test_searchbase.py�
setUpClassszSearchDialogBaseTest.setUpClasscCs|j��|j��|`dS�N)r�update_idletasks�destroyrrrr�
tearDownClass!s

z"SearchDialogBaseTest.tearDownClasscCs&t�|j�|_tj|j|jd�|_dS)N)r�engine)�seZSearchEnginerr�sdbZSearchDialogBase�dialog��selfrrr�setUp'szSearchDialogBaseTest.setUpcCs|j��dSr)r�closerrrr�tearDown+szSearchDialogBaseTest.tearDowncCs�d|j_t|j�}t|�}|j�|�|�|jj��d�|j�	�|�|jj��d�|jj|dd�|�|jj
��d�|��|�
�dS)NZnormalZ	withdrawn�hello)Zsearchphrase)r�default_commandrrr�open�assertEqual�top�stater�ent�getrr)rZtoplevel�textrrr�test_open_and_close.s

z(SearchDialogBaseTest.test_open_and_closecCs~t�|j_t�|j_t�|j_t�|j_d|j_|j��|�|jjj	�|�|jjj	�|�|jjj	�|�|jjj	�dSr)
r	r�create_entries�create_option_buttons�create_other_buttons�create_command_buttonsrZcreate_widgetsZ
assertTrueZcalledrrrr�test_create_widgets>s




z(SearchDialogBaseTest.test_create_widgetscCs�|j}d|j_|j|j_|j�dd�\}}||dd�|�|��d�|��}|t	|d�d�|t	|d�d�|t	|d�d�|t	|d	�d�||jjd�dS)
NrzTest:rr&�row�column�ZrowspanZ
columnspan)
r!rr-rr"Z
make_entry�assertInr%Z	grid_info�int)rZequal�entry�labelZegirrr�test_make_entryLs
z$SearchDialogBaseTest.test_make_entrycCs@|j|j_d|j_|j�d�|j��|�|jj�	�d�dS)Nrr)
rrr"r-rZsetpatr(r0r$r%rrrr�test_create_entries[s


z(SearchDialogBaseTest.test_create_entriescCsdd|j_|j|j_|j��\}}|�|d�|�tt|��d�|j�d�\}}|�|dd�dS)Nr�z<class 'tkinter.ttk.Frame'>Z	testlabelr&)rr-rr"Z
make_framer!�str�type)r�framer3rrr�test_make_framebs
z$SearchDialogBaseTest.test_make_framecCs|j|j_d|j_|�S)Nr)rrr"r-)r�methrrr�btn_test_setupns
z#SearchDialogBaseTest.btn_test_setupc	Cs�|j}dD]z}|j|j|j|jfD]}|�|�q"|�|jj�\}}t	||�
��D]0\}}|\}}|�|d|�|�|��|�qRq
dS)N)rr/r&)
rZrevarZcasevarZwordvarZwrapvar�setr<rr)�zip�pack_slavesr!r%)	r�er#�varr9�options�spec�buttonr3rrr�test_create_option_buttonsss�z/SearchDialogBaseTest.test_create_option_buttonsc
Cs~dD]t}|jj}|�|�|�|jj�\}}|��}t||�D]8\}}|\}}	|�|d|	�||kr>|�|�	�|�q>qdS)N)FTr&)
rZbackvarr=r<rr*r?r>r!r%)
rr#rAr9ZothersZbuttonsrCrD�valr3rrr�test_create_other_buttonss
�z.SearchDialogBaseTest.test_create_other_buttonscCs@|j|j_t|jj�|j_|j�d|jj�}|�|dd�dS)NZTestr&)rrr"r�buttonframeZmake_buttonrr!)rZbtnrrr�test_make_button�s
z%SearchDialogBaseTest.test_make_buttoncCsN|j|j_|j��d}|jj��D]}|ddkr$|d}q$|�d|�dS)Nr6r&�CloseZcommandr)rrr"r+rHZwinfo_childrenr0)rZclosebuttoncommandZchildrrr�test_create_command_buttons�s


z0SearchDialogBaseTest.test_create_command_buttonsN)�__name__�
__module__�__qualname__�classmethodrrrrr'r,r4r5r:r<rErGrIrKrrrrr
s 

r
�__main__�)�	verbosity�exit)�__doc__ZunittestZtest.supportr�tkinterrrrZtkinter.ttkrZidlelibrrrrZidlelib.idle_test.mock_idler	ZTestCaser
rL�mainrrrr�<module>s