• File: test_help_about.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/test_help_about.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 6.54 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Nj!@sdZddlmZddlZddlmZmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlZdd	lmZejZGd
ddejZGdd
d
ejZGdddejZGdddZGdddejZedkrejdddS)zTest help_about, coverage 100%.
help_about.build_bits branches on sys.platform='darwin'.
'100% combines coverage on Mac and others.
)
help_aboutN)requiresfindfile)TkTclError)Func)	Mbox_func)textview)python_versionc@sPeZdZdZeddZeddZddZdd	Zd
dZ	dd
Z
ddZdS)LiveDialogTestzmSimulate user clicking buttons other than [Close].

    Test that invoked textview has text from source.
    cCs0tdt|_|jt|jddd|_dS)Nguiz
About IDLET)_utest)rrrootwithdrawAboutdialog)clsrF/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_help_about.py
setUpClasss
zLiveDialogTest.setUpClasscCs |`|j|j|`dS)N)rrupdate_idletasksdestroy)rrrr
tearDownClasss

zLiveDialogTest.tearDownClasscCs|tddS)N)Z32Z64)ZassertInr
build_bits)selfrrrtest_build_bits&szLiveDialogTest.test_build_bitscCs||jddS)zTest about dialog titlez
About IDLEN)assertEqualrtitle)rrrrtest_dialog_title)sz LiveDialogTest.test_dialog_titlecCs8tj|jjd\}}tj|\}}||ddS)zTest about dialog logo.fileZidle_48N)ospathsplitrZ
icon_imagesplitextr)rr!rfnZextrrrtest_dialog_logo-szLiveDialogTest.test_dialog_logoc
Cs|j}|jtdf|jtdf|jtdfg}x|D]\}}}|j|dz||	|j
jjj
j}|j}t|dkr||d||d|dd	||d
|dd|j
Wd
QRXq.Wd
S)z1Test buttons whose commands use printer function.license	copyrightcredits)namez full text was not foundrz1.0z1.endz2.0z2.endN)rZ
py_licenser&Zpy_copyrightr'Z
py_creditsr(subTest_Printer__setupinvoke_current_textview	viewframe	textframetextget_Printer__lineslenZfailrr)rrbutton_sourcesbuttonZprinterr)r3linesrrrtest_printer_buttons3s

z#LiveDialogTest.test_printer_buttonsc	Cs|j}|jjddf|jjddf|jjddfg}x|D]\}}}|j|d|t|dd	}|jjj	j
j}t|d
dB}|
||dd
||
||ddWdQRX|jWdQRXq4WdS)z Test buttons that display files.z
README.txtreadmezNEWS.txtZnewszCREDITS.txtr()r)idlelib)Zsubdirzutf-8)encodingz1.0z1.endz3.0z3.endN)rr:	idle_newsidle_creditsr,r.rr/r0r1r2r3openrreadlinestripr)	rrr6r7filenamer)r$r3frrrtest_file_buttonsFs$z LiveDialogTest.test_file_buttonsN)__name__
__module____qualname____doc__classmethodrrrrr%r9rDrrrrrsrc@s0eZdZdZeddZeddZddZdS)	DefaultTitleTestzTest default title.cCs.tdt|_|jt|jdd|_dS)NrT)r
)rrrrrr)rrrrr\s
zDefaultTitleTest.setUpClasscCs |`|j|j|`dS)N)rrrr)rrrrrcs

zDefaultTitleTest.tearDownClasscCs*||jdtdtddS)zTest about dialog titlezAbout IDLE z (z bit)N)rrrr
rr)rrrrrjsz"DefaultTitleTest.test_dialog_titleN)rErFrGrHrIrrrrrrrrJYsrJc@s0eZdZdZeddZeddZddZdS)		CloseTestz%Simulate user clicking [Close] buttoncCs0tdt|_|jt|jddd|_dS)Nrz
About IDLET)r
)rrrrrr)rrrrrts
zCloseTest.setUpClasscCs |`|j|j|`dS)N)rrrr)rrrrr{s

zCloseTest.tearDownClassc	CsB||jd|jj|t|jWdQRXdS)NZToplevel)rrZwinfo_classZ	button_okr.ZassertRaisesr)rrrr
test_closeszCloseTest.test_closeN)rErFrGrHrIrrrLrrrrrKqsrKc@s(eZdZejZejZejZ	ej
Z
dZdS)Dummy_about_dialogTN)rErFrGrZshow_idle_creditsr>Zshow_readmeidle_readmeZshow_idle_newsr=Zdisplay_file_textr
rrrrrMs
rMc@s6eZdZdZeZeddZeddZddZ	dS)	DisplayFileTestzTest 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_dS)N)	r		showerror
orig_error	view_text	orig_viewrerrorrview)rrrrrszDisplayFileTest.setUpClasscCs|jt_|jt_dS)N)rQr	rPrSrR)rrrrrszDisplayFileTest.tearDownClassc
Csrxl|jj|jj|jjfD]R}d|j_d|j_|j|d,||	|jjd|	|jjdWdQRXqWdS)NF)handlerT)
rr>rNr=rTmessagerUZcalledr,r)rrWrrrtest_file_displaysz!DisplayFileTest.test_file_displayN)
rErFrGrHrMrrIrrrYrrrrrOs
	rO__main__r*)	verbosity)rHr;rZunittestZtest.supportrrZtkinterrrZidlelib.idle_test.mock_idlerZidlelib.idle_test.mock_tkrr	Zos.pathr platformr
ZAboutDialogrZTestCaserrJrKrMrOrEmainrrrr<module>s"F
"