python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_pulldom.cpython-312.opt-2.pyc

ΑeT1fddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZeddZd	Z
Gd
dejZGdd
ejZGddeZGddeZGdde	j(ZGddejZedk(rej0yy)N)AttributesImpl)feature_external_ges)pulldom)findfileztest.xmlxmltestdata)subdira
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xdc="http://www.xml.com/books">
<!-- A comment -->
<title>Introduction to XSL</title>
<hr/>
<p><xdc:author xdc:attrib="prefixed attribute" attrib="other attrib">A. Namespace</xdc:author></p>
</html>cleZdZdZdZdZejdZejdZ	dZ
y)PullDOMTestCasec	tjt}|j|jj
t
|ttd5}t
tj|dddy#1swYyxYw)Nrb)rparsetstfile
addCleanupstreamcloselistopen)selfhandlerfins   E/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_pulldom.py
test_parsezPullDOMTestCase.test_parsesf4--(,,-W
'4
 	%Cs#$	%	%	%sBBc|		tjt}t|\}}|j	t|d|j
tj|t|\}}|j
tj||j
d|j|j
dt|j|j
|jjdjdt|\}}|j
tj|t|\}}|j
tj|t|\}}|j
d|j|}t|\}}|j
tj||j
d|jt|\}}|j
tj ||j
d|j|j	||ut|\}}|j
tj|t|\}}|j
tj||j
d|jt|\}}|j
tj ||j
d|jt|\}}|j
tj|t|\}}|j
tj||j
d	|jt|\}}|j
tj||j
d
|jt|\}}|j
tj|t|\}}|j
tj ||j
d
|jt|\}}|j
tj |t|\}}|j
tj|t|\}}|j
tj |y)N
createElementhtmlz	xmlns:xdczhttp://www.xml.com/bookstitlezIntroduction to XSLhrpz
xdc:author)rparseStringSMALL_SAMPLEnext
assertTruehasattrassertEqualSTART_DOCUMENT
START_ELEMENTtagNamelen
attributesgetNamedItemvalue
CHARACTERSdataEND_ELEMENT)ritemsevtnode
title_nodes     rtest_parse_semanticsz$PullDOMTestCase.test_parse_semantics+s4##L1K	To67//5K	T..4.C0155kBHH(	*K	T++S1K	T	
++S1K	T$,,/
K	T++S1.		:K	T,,c2$,,/
d*+K	T++S1K	T..4t||,K	T,,c2t||,K	T++S1K	T..4dll+K	T..4t||4K	T++S1K	T,,c2t||4K	T,,c2K	T++S1K	T,,c2c	tjt}|D]`\}}|tjk(s|jdk(s*|j||j
dt|jn|jd|D]\}}|tjk(sn|j
djd|j||j
t|dtjt|\}}|j
|jd|j|t|t|\}}|j
|jd|jt5t|ddd|j|j|j |j|j"y#1swYPxYw)	Nrz,No "title" element detected in SMALL_SAMPLE!rz=expandNode did not leave DOMEventStream in the correct state.rrr)rr r!r'r(
expandNoder%r)
childNodesfailr"r-assertRaises
StopIterationclearassertIsNoneparserr)rr0r1itemr2s     rtest_expandItemzPullDOMTestCase.test_expandItemis2##L1	HICg+++0G  &  C$89		H
IIFG	ICg+++		
t||K	M	eQ););<K	Ts+
UK	Tv.


}
-	K	

%,,'%,,'			sG**G3c	tjt}|D]\}}|tjk(sy|j	dy)NzNo comment was encountered)rr r!COMMENTr:)rr0r1_s    rtest_commentzPullDOMTestCase.test_commentsF8##L1	4FCgoo%	4
II23r5c4	tjt}|D]*\}}|tjk(s|jdk(s*n	t|\}}|j
tj|y#t$r|jdYywxYw)Nrz8Ran out of events, but should have received END_DOCUMENT)
rr r!r/r(r"r%END_DOCUMENTr<r:)rr0r1r2s    rtest_end_documentz!PullDOMTestCase.test_end_documents=##L1	ICg)))dllf.D		LUICW1137	LIIJ
L	Ls.A::BBctjt}|j}|j	t
}|j
|dy)NF)rr r!r?
getFeaturerr%)rr?	saxparsergess    rtest_external_ges_defaultz)PullDOMTestCase.test_external_ges_defaults<$$\2MM	""#78e$r5N)__name__
__module____qualname__rr4rAunittestexpectedFailurerErHrMr5rr
r
sN% 93|(@44
L
L%r5r
cFeZdZ	dZej
dZdZddZy)ThoroughTestCasecb	|jtjdty)N)r?)_test_thoroughrr
SAXExerciserrs rtest_thorough_parsez$ThoroughTestCase.test_thorough_parses >GMM$|~FGr5cR	tdtd}|j|y)N)SAX2DOMTestHelperrXrWrpds  rtest_sax2dom_failz"ThoroughTestCase.test_sax2dom_fails#@
t\^R
8Br5cT	tdtd}|j|dy)Nr\F)r]SAX2DOMExerciserrWr^s  rtest_thorough_sax2domz&ThoroughTestCase.test_thorough_sax2doms'>
t%5%7
<B&r5c	t|\}}|jtj||j	t|d|rt|\}}|jtj||jd|jt|\}}|jtj||jd|j|jd|jt|\}}|jtj||jd|jt|\}}|jtj||jd|jt|\}}|jtj||jd|j|jd|jt|\}}|jtj||jd|jt|\}}|jtj||jd|jt|\}}|jtj||jd|jt|\}}|jtj||jd|jt|\}}|jtj|y)Nr	a commenttargetr.rrtext)r"r%rr&r#r$rCr.PROCESSING_INSTRUCTIONrfr'r(r-r/rG)rr_before_rootr1r2s     rrWzThoroughTestCase._test_thoroughsx	H	T//5o67RICW__c2[$))4RICW;;SAXt{{3VTYY/H	T..4.H	T#.dii0H	T77=4;;/+H	T..4dll+H	T++S1+H	T,,c2dll+H	T,,c2.H	T--s3r5N)T)	rNrOrPrZrQrRr`rcrWrSr5rrUrUs/2H  
'
,4r5rUc(eZdZ	dZdZdZeZeZy)rXc||_yN)_handler)rrs  rsetContentHandlerzSAXExerciser.setContentHandlers	
r5c|j}|j|jd|jdd|j	dti|jd|jdd|j	dtddi|j
d|jd|jd|jy)	Nrerfr.rrclass	paraclassrg)	rm
startDocumentcommentprocessingInstructionstartElementr
characters
endElementendDocumentrrDhs   rr
zSAXExerciser.parsesMM		
		+	&1	v~b12			+	&1	sNG[+ABC	V	S	V	

r5c	yrlrS)rargskwargss   rstubzSAXExerciser.stubs(r5N)rNrOrPrnr
r~setProperty
setFeaturerSr5rrXrXs"* (
KJr5rXceZdZ	dZy)rbcx|j}|j|jdti|j	d|jdd|jdtddi|j
d|jd|jd|jy)	Nrrerfr.rrprqrg)	rmrrrurrsrtrvrwrxrys   rr
zSAX2DOMExerciser.parsesMM		v~b12			+	&1	sNG[+ABC	V	S	V	

r5N)rNrOrPr
rSr5rrbrb
s
D
r5rbceZdZ	dZy)r]ctj|_|jjtj
jjd|jj|jy)Nr7)	rSAX2DOMr?rxmlsaxrfeature_namespacesrnrYs rresetzSAX2DOMTestHelper.reset!sH(swwAA1E%%dll3r5N)rNrOrPrrSr5rr]r]s
;4r5r]c eZdZddZdZdZy)SAX2DOMTestCasec(|j||yrl)r#)rtesttestnames   rconfirmzSAX2DOMTestCase.confirm*sh'r5cv	tjt5}t|tj
j
tt}|D]*\}}|tjk(s|jdk(s*n|jtjddddy#1swYyxYw)Nrr)
ioStringIOr!r]rrmake_parserr)rr'r(
assertGreaterr9)rrsdr1r2s     r
test_basiczSAX2DOMTestCase.test_basic-s5
[[
&	8#"3(;(;(=#&|#46B
	T'///DLLF4J


s4??3Q7	8	8	8sAB/.B/>(B//B8c	tj}|j|jdi|j	d|jdi|j	d|jd|j	d|jd|j
|j}|j}|j\}}}|jd}|j|j|j|j||j|j||j|j||j|j||j|j|j|j|j|j|j|j||j|j||j|j||j|j||j|j||jy)Ndocrgsubelmr)rrrrrurvrwrxdocumentdocumentElementr9r>previousSiblingassertIsnextSibling
parentNodeunlink)rsax2domrroottext1elm1text2text3s        rtestSAX2DOMzSAX2DOMTestCase.testSAX2DOM9s7//#UB'6"Xr*6"8$6"5!""#e"%//0

e''.

d**E2

d&&.

e++T2%++,%//0%++,

doos+

e&&-

doot,

e&&-

e&&-

r5N)Test)rNrOrPrrrrSr5rrr(s(
8 r5r__main__)rrQxml.saxrxml.sax.xmlreaderrxml.sax.handlerrxml.domrtest.supportrrr!TestCaser
rUobjectrXrbDOMEventStreamr]rrNmainrSr5r<module>rs	,0!:m
4N%h''N%b>4x((>4B6D|"4..41h''1hzHMMOr5