HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/test_searchbase.cpython-310.pyc
o

�i;�@s�dZddlZddlmZddlmZmZmZddlm	Z	ddl
mZddl
m
ZddlmZGd	d
�d
ej�ZedkrDejddd
�dSdS)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�>/usr/local/lib/python3.10/idlelib/idle_test/test_searchbase.py�
setUpClassszSearchDialogBaseTest.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_t|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�frameZ
make_entry�assertInr%Z	grid_info�int)rZequal�entry�labelZegirrr�test_make_entryLsz$SearchDialogBaseTest.test_make_entrycCsDt|j�|j_d|j_|j�d�|j��|�|jj	�
�d�dS)Nrr)rrrr0r-rZsetpatr(r1r$r%rrrr�test_create_entries[s

z(SearchDialogBaseTest.test_create_entriescCshd|j_t|j�|j_|j��\}}|�|d�|�tt|��d�|j�d�\}}|�|dd�dS)Nr�z<class 'tkinter.ttk.Frame'>Z	testlabelr&)	rr-rrr0Z
make_framer!�str�type)rr0r4rrr�test_make_framebsz$SearchDialogBaseTest.test_make_framecCst|j�|j_d|j_|�S)Nr)rrrr0r-)r�methrrr�btn_test_setupnsz#SearchDialogBaseTest.btn_test_setupc	Cs�|j}dD]=}|j|j|j|jfD]}|�|�q|�|jj�\}}t	||�
��D]\}}|\}}|�|d|�|�|��|�q)qdS)N)rr/r&)
rZrevarZcasevarZwordvarZwrapvar�setr<rr)�zip�pack_slavesr!r%)	r�er#�varr0�options�spec�buttonr4rrr�test_create_option_buttonsss���z/SearchDialogBaseTest.test_create_option_buttonsc
Cs~dD]:}|jj}|�|�|�|jj�\}}|��}t||�D]\}}|\}}	|�|d|	�||kr;|�|�	�|�qqdS)N)FTr&)
rZbackvarr=r<rr*r?r>r!r%)
rr#rAr0ZothersZbuttonsrCrD�valr4rrr�test_create_other_buttonss
����z.SearchDialogBaseTest.test_create_other_buttonscCsDt|j�|j_t|jj�|j_|j�d|jj�}|�|dd�dS)NZTestr&)rrrr0�buttonframeZmake_buttonrr!)rZbtnrrr�test_make_button�sz%SearchDialogBaseTest.test_make_buttoncCsRt|j�|j_|j��d}|jj��D]}|ddkr |d}q|�d|�dS)Nr7r&�CloseZcommandr)rrrr0r+rHZwinfo_childrenr1)rZclosebuttoncommand�childrrr�test_create_command_buttons�s
�z0SearchDialogBaseTest.test_create_command_buttonsN)�__name__�
__module__�__qualname__�classmethodrrrrr'r,r5r6r:r<rErGrIrLrrrrr
s"

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