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

Nj@sdZddlmZddlZddlmZddlZddlm	Z	ddl
mZdddhZd	hZ
ee
BZGd
ddejZGdd
d
ejZGdddejZedkrejdddS)z%Test macosx, coverage 45% on Windows.)macosxN)requires)FileListcarboncocoaxquartzotherc@s0eZdZdZeddZeddZddZdS)	InitTktypeTestzTest _init_tk_type.cCs(tdt|_|jtj|_dS)Ngui)rtkTkrootwithdrawrplatform
orig_platform)clsrB/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_macosx.py
setUpClasss

zInitTktypeTest.setUpClasscCs$|j|j|`|jt_dS)N)r
update_idletasksdestroyrrr)rrrr
tearDownClasss

zInitTktypeTest.tearDownClassc
Cs`xZdtfdtffD]F\}}|j|d,|t_tjdkt|tj|WdQRXqWdS)z<Test that _init_tk_type sets _tk_type according to platform.darwinr)rN)alltypesnontypessubTestrr_tk_typeZ
_init_tk_typeZassertIn)selfrtypesrrrtest_init_sets_tktype s
z$InitTktypeTest.test_init_sets_tktypeN)__name__
__module____qualname____doc__classmethodrrrrrrrr	sr	c@sNeZdZdZejdfejdfejdfejdffZ	e
dddZd	d
Z
dS)IsTypeTkTestz*Test each of the four isTypeTk predecates.)rrrrrzidlelib.macosx._init_tk_typec
CsPdt_xD|jD]:\}}|j|d |||j|WdQRXqWdS)zBTest that each isTypeTk calls _init_tk_type when _tk_type is None.N)func)rrisfuncsr
assertTruecalled
reset_mock)rZmockinitr&whentruerrrtest_is_calls_init2szIsTypeTkTest.test_is_calls_initcCsbx\|jD]R\}}xHtD]@}|j|||d&|t_||kr@|jn|j|WdQRXqWqWdS)z,Test that each isTypeTk return correct bool.)r&r+tktypeN)r'rrrrr(ZassertFalse)rr&r+r-rrrtest_isfuncs<s
zIsTypeTkTest.test_isfuncsN)r r!r"r#rZisAquaTkZ
isCarbonTkZ	isCocoaTkZ	isXQuartzr'mockpatchr,r.rrrrr%*s
r%c@s:eZdZdZeddZeddZedddZ	d	S)
	SetupTestzTest setupApp.cs4tdt|_|jfdd|j_dS)Nr
cs$t|tstt|ts tdS)N)
isinstancestrAssertionErrortype)Ztkpathr&)cmdrrr6Nsz!SetupTest.setUpClass.<locals>.cmd)rrrr
rZ
createcommand)rr)r6rrIs


zSetupTest.setUpClasscCs|j|j|`dS)N)r
rr)rrrrrSs

zSetupTest.tearDownClasszidlelib.macosx.overrideRootMenuc
Csf|j}t|}xRtD]J}|j|d4|t_t|||dkrL||j|	WdQRXqWdS)z/Call setupApp with each possible graphics type.)r-)rrN)
r
rrrrrZsetupAppr(r)r*)rZoverrideRootMenur
Zflistr-rrr
test_setupappYs
zSetupTest.test_setupappN)
r r!r"r#r$rrr/r0r7rrrrr1Fs
r1__main__)	verbosity)r#ZidlelibrZunittestZtest.supportrZtkinterrZ
unittest.mockr/Zidlelib.filelistrZmactypesrrZTestCaser	r%r1r mainrrrr<module>s
!