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_help_about.cpython-310.pyc
o

�i�@s�dZddlmZddlZddlmZmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlZdd	lmZejZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZGdd�d�ZGdd�dej�Zedkrrejdd�dSdS)z�Test help_about, coverage 100%.
help_about.build_bits branches on sys.platform='darwin'.
'100% combines coverage on Mac and others.
�)�
help_aboutN)�requires�findfile)�Tk�TclError)�Func)�	Mbox_func)�textview)�python_versionc@sPeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�LiveDialogTestzmSimulate user clicking buttons other than [Close].

    Test that invoked textview has text from source.
    cC�0td�t�|_|j��t|jddd�|_dS�N�gui�
About IDLET��_utest�rr�rootZwithdraw�About�dialog��cls�r�>/usr/local/lib/python3.10/idlelib/idle_test/test_help_about.py�
setUpClass�
zLiveDialogTest.setUpClasscC� |`|j��|j��|`dS�N�rrZupdate_idletasks�destroyrrrr�
tearDownClass�

zLiveDialogTest.tearDownClasscCs|�t��d�dS)N)Z32Z64)ZassertInr�
build_bits��selfrrr�test_build_bits&szLiveDialogTest.test_build_bitscCs|�|j��d�dS)�Test about dialog titlerN)�assertEqualr�titler#rrr�test_dialog_title)sz LiveDialogTest.test_dialog_titlecCs8tj�|jjd�\}}tj�|�\}}|�|d�dS)zTest about dialog logo.�fileZidle_48N)�os�path�splitrZ
icon_image�splitextr')r$r,r*�fn�extrrr�test_dialog_logo-szLiveDialogTest.test_dialog_logoc	Cs�|j}|jtdf|jtdf|jtdfg}|D]U\}}}|j|d��B|��|�	�|j
jjj
j}|j}t|�dkrA|�|d�|�|d|dd	��|�|d
|dd��|j
��Wd
�n1sfwYqd
S)z1Test buttons whose commands use printer function.�license�	copyright�credits��name�z full text was not foundr�1.0�1.end�z2.0z2.endN)rZ
py_licenser2Zpy_copyrightr3Z
py_creditsr4�subTest�_Printer__setup�invoke�_current_textview�	viewframe�	textframe�text�get�_Printer__lines�lenZfailr'r)r$r�button_sources�buttonZprinterr6rB�linesrrr�test_printer_buttons3s&


����z#LiveDialogTest.test_printer_buttonsc	
Cs|j}|jjddf|jjddf|jjddfg}|D]e\}}}|j|d��R|��t|dd	�}|jjj	j
j}t|d
d��&}|�
|����|dd
��|��|�
|����|dd��Wd�n1sewY|j��Wd�n1sywYqdS)z Test buttons that display files.z
README.txt�readmezNEWS.txt�newszCREDITS.txtr4r5�idlelib)Zsubdirzutf-8)�encodingr8r9z3.0z3.endN)rrI�	idle_news�idle_creditsr;r=rr>r?r@rArB�openr'�readline�stripr)	r$rrErF�filenamer6r/rB�frrr�test_file_buttonsFs&�����z LiveDialogTest.test_file_buttonsN)�__name__�
__module__�__qualname__�__doc__�classmethodrr r%r)r1rHrTrrrrrs

rc@�0eZdZdZedd��Zedd��Zdd�ZdS)	�DefaultTitleTestzTest default title.cCs.td�t�|_|j��t|jdd�|_dS)NrTrrrrrrr\s
zDefaultTitleTest.setUpClasscCrrrrrrrr cr!zDefaultTitleTest.tearDownClasscCs*|�|j��dt��dt���d��dS)r&zAbout IDLE z (z bit)N)r'rr(r
rr"r#rrrr)js

��z"DefaultTitleTest.test_dialog_titleN)rUrVrWrXrYrr r)rrrrr[Y�

r[c@rZ)	�	CloseTestz%Simulate user clicking [Close] buttoncCrr
rrrrrrtrzCloseTest.setUpClasscCrrrrrrrr {r!zCloseTest.tearDownClasscCsX|�|j��d�|jj��|�t��|j��Wd�dS1s%wYdS)NZToplevel)r'rZwinfo_classZ	button_okr=ZassertRaisesrr#rrr�
test_close�s
"�zCloseTest.test_closeN)rUrVrWrXrYrr r^rrrrr]qr\r]c@s(eZdZejZejZejZ	ej
Z
dZdS)�Dummy_about_dialogTN)rUrVrWrZshow_idle_creditsrNZshow_readme�idle_readmeZshow_idle_newsrMZdisplay_file_textrrrrrr_�sr_c@s6eZdZdZe�Zedd��Zedd��Zdd�Z	dS)	�DisplayFileTestz�Test functions that display files.

    While somewhat redundant with gui-based test_file_dialog,
    these unit tests run on all buildbots, not just a few.
    cCs4tj|_tj|_t�|_t�|_|jt_|jt_dSr)	r	�	showerror�
orig_error�	view_text�	orig_viewr�errorr�viewrrrrr�szDisplayFileTest.setUpClasscCs|jt_|jt_dSr)rcr	rbrerdrrrrr �szDisplayFileTest.tearDownClassc	Cs�|jj|jj|jjfD]3}d|j_d|j_|j|d��|�|�	|jjd�|�	|jjd�Wd�n1s9wYqdS)N�F)�handlerT)
rrNr`rMrf�messagergZcalledr;r')r$rirrr�test_file_display�s����z!DisplayFileTest.test_file_displayN)
rUrVrWrXr_rrYrr rkrrrrra�s

ra�__main__r7)�	verbosity)rXrKrZunittestZtest.supportrr�tkinterrrZidlelib.idle_test.mock_idlerZidlelib.idle_test.mock_tkrr	Zos.pathr+�platformr
ZAboutDialogrZTestCaserr[r]r_rarU�mainrrrr�<module>s&F
"�