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

YI~d;@szddlmZddlZddlmZddlmZmZddlZddlm	Z	ddl
mZGdddejZ
Gd	d
d
ejZGdddejZGd
ddejZGdddejZGdddejZGdddejZGdddejZGdddejZGdddejZGdddejZGdddejZGdd d ejZGd!d"d"ejZGd#d$d$ejZed%krvejd&d'd(dS)))queryN)requires)TkEND)mock)Varc@sBeZdZGdddZddZddZddZd	d
ZddZd
S)	QueryTestc@s<eZdZejjZejjZejjZddZddZ	ddZ
dS)zQueryTest.Dummy_QuerycCs&t|d|_ddi|_d|_d|_dS)N)valuetextF)rentryentry_errorresult	destroyed)selfdummy_entryrA/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_query.py__init__!s
zQueryTest.Dummy_Query.__init__cCs||jd<dS)Nr
)r
)rmessagerrr	showerror&szQueryTest.Dummy_Query.showerrorcCs
d|_dS)NT)r)rrrrdestroy(szQueryTest.Dummy_Query.destroyN)__name__
__module____qualname__rQueryentry_okokcancelrrrrrrrDummy_QuerysrcCsD|d}||d||j|jfd|d|jddS)N )NFz
blank liner
)rassertEqualrrrassertInr
)rdialogrrrtest_entry_ok_blank+s
zQueryTest.test_entry_ok_blankcCsD|d}|j}||d||j|jfd||jdddS)Nz  good good)NFr
r)rr!rrrr
)rr#Equalrrrtest_entry_ok_good1s

zQueryTest.test_entry_ok_goodcCsT|d}t|j_||d||jjj|j`||j	|j
fddS)Nr)NF)rrMockrZ	focus_setr!r
assertTruecalledrr)rr#rrr
test_ok_blank8s
zQueryTest.test_ok_blankcCs2|d}||d||j|jfddS)Nr%)r%T)rr!rrr)rr#rrrtest_ok_good@s
zQueryTest.test_ok_goodcCs2|d}||d||j|jfddS)Nzdoes not matter)NT)rr!rrr)rr#rrrtest_cancelEs
zQueryTest.test_cancelN)	rrrrr$r'r+r,r-rrrrrsrc@s:eZdZGdddZddZddZddZd	d
ZdS)SectionNameTestc@s*eZdZejjZdgZddZddZdS)z!SectionNameTest.Dummy_SectionNameusedcCst|d|_ddi|_dS)N)r	r
r)rrr
)rrrrrrQsz*SectionNameTest.Dummy_SectionName.__init__cCs||jd<dS)Nr
)r
)rrrrrrTsz+SectionNameTest.Dummy_SectionName.showerrorN)	rrrrSectionNamer
used_namesrrrrrrDummy_SectionNameNsr2cCs0|d}||d|d|jddS)Nr zno namer
)r2r!rr"r
)rr#rrrtest_blank_section_nameWs
z'SectionNameTest.test_blank_section_namecCs0|d}||d|d|jddS)Nr/Zuser
)r2r!rr"r
)rr#rrrtest_used_section_name\s
z&SectionNameTest.test_used_section_namecCs0|d}||d|d|jddS)NZ goodgoodgoodgoodgoodgoodgoodgoodzlonger than 30r
)r2r!rr"r
)rr#rrrtest_long_section_nameas
z&SectionNameTest.test_long_section_namecCs0|d}||d||jdddS)Nz  good r%r
r)r2r!rr
)rr#rrrtest_good_section_namefs
z&SectionNameTest.test_good_section_nameN)rrrr2r3r4r5r6rrrrr.Ks
	r.c@s:eZdZGdddZddZddZddZd	d
ZdS)ModuleNameTestc@s(eZdZejjZdZddZddZdS)zModuleNameTest.Dummy_ModuleNamercCst|d|_ddi|_dS)N)r	r
r)rrr
)rrrrrrrsz(ModuleNameTest.Dummy_ModuleName.__init__cCs||jd<dS)Nr
)r
)rrrrrrusz)ModuleNameTest.Dummy_ModuleName.showerrorN)	rrrr
ModuleNamertext0rrrrrrDummy_ModuleNameosr:cCs0|d}||d|d|jddS)Nr zno namer
)r:r!rr"r
)rr#rrrtest_blank_module_namexs
z%ModuleNameTest.test_blank_module_namecCs0|d}||d|d|jddS)NZ __name_xyz123_should_not_exist__z	not foundr
)r:r!rr"r
)rr#rrrtest_bogus_module_name}s
z%ModuleNameTest.test_bogus_module_namecCs0|d}||d|d|jddS)N	itertoolszsource-basedr
)r:r!rr"r
)rr#rrrtest_c_source_names
z!ModuleNameTest.test_c_source_namecCs4|d}||d||jdddS)Nidlelibz__init__.pyr
r)r:r)rendswithr!r
)rr#rrrtest_good_module_names
z$ModuleNameTest.test_good_module_nameN)rrrr:r;r<r>rArrrrr7ls
	r7c@s2eZdZGdddZddZddZddZd	S)
GotoTestc@s$eZdZejjZddZddZdS)zGotoTest.Dummy_ModuleNamecCst|d|_ddi|_dS)N)r	r
r)rrr
)rrrrrrsz"GotoTest.Dummy_ModuleName.__init__cCs||jd<dS)Nr
)r
)rrrrrrsz#GotoTest.Dummy_ModuleName.showerrorN)rrrrGotorrrrrrrr:sr:cCs0|d}||d|d|jddS)Naznot a base 10 integerr
)r:r!rr"r
)rr#rrrtest_bogus_gotos
zGotoTest.test_bogus_gotocCs0|d}||d|d|jddS)N0znot a positive integerr
)r:r!rr"r
)rr#rrr
test_bad_gotos
zGotoTest.test_bad_gotocCs0|d}||d||jdddS)N1r
r)r:r!rr
)rr#rrrtest_good_gotos
zGotoTest.test_good_gotoN)rrrr:rErGrJrrrrrBsrBc@s"eZdZGdddZddZdS)HelpsourceBrowsefileTestc@seZdZejjZeZdS)z)HelpsourceBrowsefileTest.Dummy_HelpSourceN)rrrr
HelpSourcebrowse_filerpathvarrrrrDummy_HelpSourcesrOc
Cs|}xddddfdddtfddddfdddtffD]J\}}}|2|j|||_|||j|WdQRXq>WdS)NrcSsdS)Nrr)rDbcrrr<lambda>zBHelpsourceBrowsefileTest.test_file_replaces_path.<locals>.<lambda>cSstS)N)__file__)rDrPrQrrrrRrSZhtestcSsdS)Nrr)rDrPrQrrrrRrScSstS)N)rT)rDrPrQrrrrRrS)	rOrTsubTestrNsetZaskfilenamerMr!get)rr#pathfuncrrrrtest_file_replaces_paths
z0HelpsourceBrowsefileTest.test_file_replaces_pathN)rrrrOrZrrrrrKsrKc@sLeZdZGdddZejZeddZddZ	ddZ
d	d
ZddZd
S)HelpsourcePathokTestc@s&eZdZejjZddZdddZdS)z%HelpsourcePathokTest.Dummy_HelpSourcecCst|d|_ddi|_dS)N)r	r
r)rrX
path_error)rZ
dummy_pathrrrrsz.HelpsourcePathokTest.Dummy_HelpSource.__init__NcCs||jd<dS)Nr
)r\)rrZwidgetrrrrsz/HelpsourcePathokTest.Dummy_HelpSource.showerror)N)rrrrrLpath_okrrrrrrrOsrOcCs|jt_dS)N)
orig_platformrplatform)clsrrr
tearDownClasssz"HelpsourcePathokTest.tearDownClasscCs0|d}||d|d|jddS)Nr zno help filer
)rOr!r]r"r\)rr#rrrtest_path_ok_blanks
z'HelpsourcePathokTest.test_path_ok_blankcCs4|td}||d|d|jddS)Nzbad-bad-badz	not existr
)rOrTr!r]r"r\)rr#rrrtest_path_ok_badsz%HelpsourcePathokTest.test_path_ok_badc
Csd|d}|j}xNdD]F}|4|j||||||jddWdQRXqWdS)Nr)z
www.py.orgz
http://py.orgr
)rOr!rUrXrVr]r\)rr#r&Zurlrrrtest_path_ok_webs


z%HelpsourcePathokTest.test_path_ok_webc
Csl|d}x\dD]T\}}|>|t_|jt|||t||j	ddWdQRXqWdS)Nr))darwinzfile://)otherrr
)
rOrUrr_rXrVrTr!r]r\)rr#r_prefixrrrtest_path_ok_files

z&HelpsourcePathokTest.test_path_ok_fileN)
rrrrOrr_r^classmethodrarbrcrdrhrrrrr[s	r[c@s"eZdZGdddZddZdS)HelpsourceEntryokTestc@s,eZdZejjZiZiZddZddZ	dS)z&HelpsourceEntryokTest.Dummy_HelpSourcecCs|jS)N)name)rrrritem_oksz.HelpsourceEntryokTest.Dummy_HelpSource.item_okcCs|jS)N)rX)rrrrr]sz.HelpsourceEntryokTest.Dummy_HelpSource.path_okN)
rrrrrLrr
r\rlr]rrrrrOs
rOc
CsR|}xDdD]<\}}}|$|||_|_|||WdQRXqWdS)N))NNN)Nzdoc.txtN)docNN)rmzdoc.txt)rmzdoc.txt)rOrUrkrXr!r)rr#rkrXrrrrtest_entry_ok_helpsources

z.HelpsourceEntryokTest.test_entry_ok_helpsourceN)rrrrOrnrrrrrjs	rjc@s2eZdZGdddZddZddZddZd	S)
CustomRunCLIargsokTestc@s$eZdZejjZddZddZdS)z&CustomRunCLIargsokTest.Dummy_CustomRuncCst|d|_ddi|_dS)N)r	r
r)rrr
)rrrrrrsz/CustomRunCLIargsokTest.Dummy_CustomRun.__init__cCs||jd<dS)Nr
)r
)rrrrrrsz0CustomRunCLIargsokTest.Dummy_CustomRun.showerrorN)rrrr	CustomRuncli_args_okrrrrrrDummy_CustomRunsrrcCs|d}||gdS)Nr )rrr!rq)rr#rrrtest_blank_argss
z&CustomRunCLIargsokTest.test_blank_argscCs0|d}||d|d|jddS)Nz'no-closing-quotez
No closingr
)rrr!rqr"r
)rr#rrrtest_invalid_argss
z(CustomRunCLIargsokTest.test_invalid_argscCsPddddddg}|d|d}|||d	g||jd
ddS)Nz-nZ10z	--verbosez-pz/pathz--namer z
 "my name"zmy namer
r)rrjoinr!rqr
)rargsr#rrrtest_good_argssz%CustomRunCLIargsokTest.test_good_argsN)rrrrrrsrtrwrrrrro	sroc@s"eZdZGdddZddZdS)CustomRunEntryokTestc@s&eZdZejjZiZeZddZ	dS)z$CustomRunEntryokTest.Dummy_CustomRuncCs|jS)N)cli_args)rrrrrq+sz0CustomRunEntryokTest.Dummy_CustomRun.cli_args_okN)
rrrrrprr
r
restartvarrqrrrrrr'srrcCsx|}xjdD]b}|j|xPddgdg|fffD]8\}}|j||d||_|||WdQRXq4WqWdS)N>FT)NNzmy arg)restartry)rrrzrVrUryr!r)rr#r{ryrrrrtest_entry_ok_customrun.s
z,CustomRunEntryokTest.test_entry_ok_customrunN)rrrrrr|rrrrrx$srxc@sDeZdZeddZeddZddZddZd	d
ZddZ	d
S)QueryGuiTestcCsBtdt|_}|jtj|dddd|_t|j_	dS)NguiZTESTZtestT)_utest)
rrrootwithdrawrrr#rr(r)r`rrrr
setUpClass=s

zQueryGuiTest.setUpClasscCs|j`|`|j|`dS)N)r#rr)r`rrrraEs
zQueryGuiTest.tearDownClasscCs(|jjddd|j_|jjdS)Nrend)r#rdeleterrZ
reset_mock)rrrrsetUpLszQueryGuiTest.setUpcCs>|j}|jdd|j||jd||jj	dS)Nrabc)
r#rinsert	button_okinvoker!rr)rr*)rr#rrr
test_click_okQs

zQueryGuiTest.test_click_okcCs0|j}|j||jd||jjdS)N)r#rrr!rZassertFalserr*)rr#rrrtest_click_blankXs
zQueryGuiTest.test_click_blankcCs>|j}|jdd|j||jd||jj	dS)Nrr)
r#rrZ
button_cancelrr!rr)rr*)rr#rrrtest_click_cancel^s

zQueryGuiTest.test_click_cancelN)
rrrrirrarrrrrrrrr};sr}c@s eZdZeddZddZdS)SectionnameGuiTestcCstddS)Nr~)r)r`rrrrhszSectionnameGuiTest.setUpClasscCslt}|tj|dddhdd}|j}||jdh|jdd|j	||j
d|dS)NTtrT)rrZokay)rrrr0r!r1rrrrrr)rrr#r&rrrtest_click_section_namels
z*SectionnameGuiTest.test_click_section_nameN)rrrrirrrrrrrfsrc@s eZdZeddZddZdS)ModulenameGuiTestcCstddS)Nr~)r)r`rrrrzszModulenameGuiTest.setUpClasscCsjt}|tj|ddddd}||jd||jd|j	|
|jd|
dS)Nrrr?T)rz__init__.py)rrrr8r!r9rrWrrr)rr@r)rrr#rrrtest_click_module_name~s
z(ModulenameGuiTest.test_click_module_nameN)rrrrirrrrrrrxsrc@s eZdZeddZddZdS)GotoGuiTestcCstddS)Nr~)r)r`rrrrszGotoGuiTest.setUpClasscCsRt}|tj|dddd}|jdd|j||j	d|
dS)NrrT)rrZ22)rrrrCrrrrr!rr)rrr#rrrrs
z"GotoGuiTest.test_click_module_nameN)rrrrirrrrrrrsrc@s eZdZeddZddZdS)HelpsourceGuiTestcCstddS)Nr~)r)r`rrrrszHelpsourceGuiTest.setUpClasscCst}|tj|ddtdd}|j}||jd||jt|j	
tjdkr`dnd}||j
d|tf|dS)NrZ__test__T)Zmenuitemfilepathrrezfile://r)rrrrLrTr!rrWrXrrsysr_rr)rrr#r&rgrrrtest_click_help_sources


z(HelpsourceGuiTest.test_click_help_sourceN)rrrrirrrrrrrsrc@s eZdZeddZddZdS)CustomRunGuiTestcCstddS)Nr~)r)r`rrrrszCustomRunGuiTest.setUpClasscCsrt}|tj|dddgdd}||jd|jtd|j	
||jdddgdf|dS)	NZTitlerDzb=1T)ryrza b=1z crQ)
rrrrpr!rrWrrrrrr)rrr#rrrtest_click_argss
z CustomRunGuiTest.test_click_argsN)rrrrirrrrrrrsr__main__F)	verbosityexit)r?rZunittestZtest.supportrZtkinterrrrrZidlelib.idle_test.mock_tkrZTestCaserr.r7rBrKr[rjrorxr}rrrrrrmainrrrr<module>s.3!!-+