python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_rlcompleter.cpython-312.pyc

Αe&ddlZddlmZddlZddlZGddZGddejZedk(rejyy)N)patchceZdZdZdZdZy)
CompleteMez6 Trivial class used in testing rlcompleter.Completer. N)__name__
__module____qualname____doc__spam_hamI/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_rlcompleter.pyrrs@DDrrceZdZdZdZdZdZdZdZdZ	e
jjdd	d
Z
dZy)
TestRlcompleterctj|_tjttt
t|_|jjddy)N)reggrr)	rlcompleter	Completerstdcompleterdictintstrr	completercompleteselfs rsetUpzTestRlcompleter.setUp
sN'113$..t8;?I0KL
	
""2q)rcGddt}Gddt}|j|jj|j|jj|jtj|j|jttj|dy)NceZdZy))TestRlcompleter.test_namespace.<locals>.ANrr	r
rrrAr#rr%ceZdZy))TestRlcompleter.test_namespace.<locals>.BNr$rrrBr(r&rr))r)rlist
assertTrueruse_main_nsassertFalserrrassertRaises	TypeError)rr%r)s   rtest_namespacezTestRlcompleter.test_namespaces					
))556334..qs3??@)[%:%:AdGDrc	|jt|jjdt	t
Dcgc]}|j
ds|dzc}|jt|jjdt	t
Dcgc]}|j
ds|dzc}|j|jjdg|j|jjddg|j|jjddg|j|jjddgycc}wcc}w)	Ndi(stakaksajadhak	CompleteMzCompleteMe()egzegg()assertEqualsortedrglobal_matchesdirbuiltins
startswithr)rxs  rtest_global_matchesz#TestRlcompleter.test_global_matches!s. 1 1 @ @ FG),XMA!,,t:L!C%M	O 1 1 @ @ FG),XMA!,,t:L!C%M	O**99.I2N	
66{C()	+66t< 	#	
66{C()	+NMsE9
E9
$E>
;E>
c
`|j|jjdttDcgc]$}|jdrdj
|&c}|j|jjdgttdDchc]}d||dk7rdndc}}|j|jjd||j|jjd	||j|jjd
||j|jjddg|j|jjd
g|j|jjdddg|j|jjddg|jjd}|D]#}|j|jd|%|jd||jd|tjtdtd5|j|jjddg|j|jjdttDcgc]$}|jdrdj
|&c}dddycc}wcc}wcc}w#1swYyxYw)Nzstr.sszstr.{}(ztuple.foospameggzNone.rr3rzNone._zNone.__z
CompleteMe.spzCompleteMe.spamzCompleteme.eggzCompleteMe.zCompleteMe.mro()zCompleteMe._zCompleteMe._hamz
CompleteMe.__zCompleteMe.__name__zCompleteMe.__new__(meT)createzCompleteMe.me.me.spzCompleteMe.me.me.spamzegg.szegg.{}()r8rattr_matchesr;rr=formatr9rr+assertInrobjectr)rr>expectedmatchess    rtest_attr_matchesz!TestRlcompleter.test_attr_matches2s**77@7:3x0!\\#.$**1-0	1	
**778JKRP$'I/ +,ANS-JK/0**77@(K**77A8L**77	BHM	
44_E+,	.445EFK44]C,.?@	B44^D+,	...--o>	>AOOALL91=	>

+W5

+W5
\\*dJt
D	5T^^889NO56
8T^^88A;>s84a!"c!2(..q14
5	5	5/0/04		5	5s*)L
$L9A#L$)LL$L$$L-cGdd}|}tjt|}|j|j	ddd|j|j
dy)	z;Ensure getattr() is invoked no more than once per attributec&eZdZdZdZfdZxZS)3TestRlcompleter.test_excessive_getattr.<locals>.FoorrcX|dk(r|xjdz
c_yt|	|S)Nbarr)callssuper__getattribute__)rname	__class__s  rrRzDTestRlcompleter.test_excessive_getattr.<locals>.Foo.__getattribute__]s*5=JJ!OJw/55r)rr	r
rPrOrR
__classcell__)rTs@rFoorMZsEC
6
6rrVff.brf.barrN)rrrr8rrPrrVrXrs    rtest_excessive_getattrz&TestRlcompleter.test_excessive_getattrSsZ	6	6
E))$)4	++E15w?!$rcGdd}|}tjt|}|j|j	ddd|j|jy)Nc$eZdZdZdZedZy)<TestRlcompleter.test_property_method_not_called.<locals>.FoorFc(d|_|jS)NT)property_called_barrs rrOz@TestRlcompleter.test_property_method_not_called.<locals>.Foo.barms'+$yy rN)rr	r
rbrapropertyrOrrrrVr_isD#O

!
!rrVrWrYrrZ)rrrr8rr-rar[s    rtest_property_method_not_calledz/TestRlcompleter.test_property_method_not_calledhsZ	!	!
E))$)4	++E15w?**+rcGdd}tjt|}|j|j	dddy)NceZdZdZy)0TestRlcompleter.test_uncreated_attr.<locals>.Foo)rON)rr	r
	__slots__rrrrVrg{s IrrVrWzf.rrZ)rrrr8r)rrVrs   rtest_uncreated_attrz#TestRlcompleter.test_uncreated_attrxs?	!	!))$-8	++D!4g>rzrlcompleter._readline_availableFctj}|j|jddd|j|jddd|j|jddd|j|jdd	d
|j|jddd|j|jddd
|j|jddd|j|jddd|j|jddd|j|jddd|j|jddd|j|jddd|j|jdddy)Nrr	azand rzas asrassert anpapassFaFalseelzelif elsetrtry:_matchzmatch casezcase )rrr8r)rrs  r
test_completezTestRlcompleter.test_completes))+	++B2D9++C3V<++C3U;++D!4i@++D!4f=++D!4f=++D!4g>++D!4g>++D!4f=++D!4f=++C3S9++GQ7B++FA6@rcdddddd}tj|}|j|jddd|j	|jdd|j|jddd|j	|jdd|j|jd	dd
|j	|jd	d|j|jddd|j	|jdd|j|jddd
|j	|jddy)NcyNrrrr<lambda>z8TestRlcompleter.test_duplicate_globals.<locals>.<lambda>rcyr~rrrrrz8TestRlcompleter.test_duplicate_globals.<locals>.<lambda>rr)rsasserttry
memoryviewEllipsisrsrrrrnrrwrrz
Ellipsis())rrr8rassertIsNone)r	namespacers   rtest_duplicate_globalsz&TestRlcompleter.test_duplicate_globalssB$
	 )))4	++GQ7A),,Wa89++Ha8)D),,Xq9:++E15v>),,UA67++L!<lK),,\1=>++J:LI),,Z;<rN)rr	r
r r0r?rJr\rdriunittestmockrr{rrrrrrsU*	E+"5B%*
, ?]]:EBACA =rr__main__)
r
unittest.mockrr<rrTestCaserrmainrrr<module>rsJ

Y=h''Y=vzHMMOr