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_help_about.cpython-38.pyc
U

�i�_!�@s�dZddlmZddlZddlmZmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlZdd	lmZejZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZGdd�d�ZGdd�dej�Zedkr�ejdd�dS)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.
    cCs0td�t�|_|j��t|jddd�|_dS�N�gui�
About IDLET��_utest�rr�rootZwithdraw�About�dialog��cls�r�@/opt/python38/lib/python3.8/idlelib/idle_test/test_help_about.py�
setUpClasss
zLiveDialogTest.setUpClasscCs |`|j��|j��|`dS�N�rrZupdate_idletasks�destroyrrrr�
tearDownClasss

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�titlerrrr�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]�\}}}|j|d��z|��|�	�|j
jjj
j}|j}t|�dkr�|�|d�|�|d|dd	��|�|d
|dd��|j
��W5QRXq,d
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_licenser.Zpy_copyrightr/Z
py_creditsr0�subTest�_Printer__setup�invoke�_current_textview�	viewframe�	textframe�text�get�_Printer__lines�lenZfailr#r)r r�button_sources�buttonZprinterr2r>�linesrrr�test_printer_buttons3s 


�z#LiveDialogTest.test_printer_buttonsc	Cs�|j}|jjddf|jjddf|jjddfg}|D]�\}}}|j|d���|��t|dd	�}|jjj	j
j}t|d
d��B}|�
|����|dd
��|��|�
|����|dd��W5QRX|j��W5QRXq2dS)z Test buttons that display files.z
README.txt�readmezNEWS.txtZnewszCREDITS.txtr0r1�idlelib)Zsubdirzutf-8)�encodingr4r5z3.0z3.endN)rrE�	idle_news�idle_creditsr7r9rr:r;r<r=r>�openr#�readline�stripr)	r rrArB�filenamer2r+r>�frrr�test_file_buttonsFs�$z LiveDialogTest.test_file_buttonsN)�__name__�
__module__�__qualname__�__doc__�classmethodrrr!r%r-rDrOrrrrrs

rc@s0eZdZdZedd��Zedd��Zdd�ZdS)	�DefaultTitleTestzTest default title.cCs.td�t�|_|j��t|jdd�|_dS)Nr
Trrrrrrr\s
zDefaultTitleTest.setUpClasscCs |`|j��|j��|`dSrrrrrrrcs

zDefaultTitleTest.tearDownClasscCs*|�|j��dt��dt���d��dS)r"zAbout IDLE z (z bit)N)r#rr$r
rrrrrrr%js�z"DefaultTitleTest.test_dialog_titleN)rPrQrRrSrTrrr%rrrrrUYs

rUc@s0eZdZdZedd��Zedd��Zdd�ZdS)	�	CloseTestz%Simulate user clicking [Close] buttoncCs0td�t�|_|j��t|jddd�|_dSrrrrrrrts
zCloseTest.setUpClasscCs |`|j��|j��|`dSrrrrrrr{s

zCloseTest.tearDownClassc	CsB|�|j��d�|jj��|�t��|j��W5QRXdS)NZToplevel)r#rZwinfo_classZ	button_okr9ZassertRaisesrrrrr�
test_close�szCloseTest.test_closeN)rPrQrRrSrTrrrWrrrrrVqs

rVc@s(eZdZejZejZejZ	ej
Z
dZdS)�Dummy_about_dialogTN)rPrQrRrZshow_idle_creditsrIZshow_readme�idle_readmeZshow_idle_newsrHZdisplay_file_textrrrrrrX�s
rXc@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)r\r	r[r^r]rrrrr�szDisplayFileTest.tearDownClassc
Csn|jj|jj|jjfD]R}d|j_d|j_|j|d��,|�|�	|jjd�|�	|jjd�W5QRXqdS)N�F)�handlerT)
rrIrYrHr_�messager`Zcalledr7r#)r rbrrr�test_file_display�s�z!DisplayFileTest.test_file_displayN)
rPrQrRrSrXrrTrrrdrrrrrZ�s

rZ�__main__r3)�	verbosity)rSrFrZunittestZtest.supportrr�tkinterrrZidlelib.idle_test.mock_idlerZidlelib.idle_test.mock_tkrr	Zos.pathr'�platformr
ZAboutDialogrZTestCaserrUrVrXrZrP�mainrrrr�<module>s"F
"