%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_minidom.pyc


Nac@sddlZddlZddlmZddlmZddlZddlZddlZddl	Zddlm
Z
mZmZm
Z
ddlmZejdddZd	Zed
ZdZdZd
ejfdYZdZedkrendS(iN(tStringIO(tsupport(tparsetNodetDocumenttparseString(tgetDOMImplementationstest.xmltsubdirtxmltestdatas<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE doc PUBLIC 'http://xml.python.org/public' 'http://xml.python.org/system' [
  <!ELEMENT e EMPTY>
  <!ENTITY ent SYSTEM 'http://xml.python.org/entity'>
]><doc attr='value'> text
<?pi sample?> <!-- comment --> <e/> </doc>cCstjdd|S(Ntdoc(RtcreateDocumenttNone(tdoctype((s-/usr/local/lib/python2.7/test/test_minidom.pytcreate_doc_without_doctypescCstjddd}g|j_g|j_tjjj	ddd}|jjj
|tjjjdddd}d|_d|_
d|_|jjj
||S(	NR	smy-notations"http://xml.python.org/notations/mys	my-entitys!http://xml.python.org/entities/mys1.0sutf-8sus-ascii(RtcreateDocumentTypeRtentitiest_seqt	notationstxmltdomtminidomtNotationtappendtEntitytversiontencodingtactualEncoding(Rtnotationtentity((s-/usr/local/lib/python2.7/test/test_minidom.pytcreate_nonempty_doctype s					cCsCt}t|}||jjd_||jjd_|S(Ni(RR
Rtitemt
ownerDocumentR(RR	((s-/usr/local/lib/python2.7/test/test_minidom.pytcreate_doc_with_doctype0s
	tMinidomTestcBsceZddZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ d Z!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,d,Z-d-Z.d.Z/d/Z0d0Z1d1Z2d2Z3d3Z4d4Z5d5Z6d6Z7d7Z8d8Z9d9Z:d:Z;d;Z<d<Z=d=Z>d>Z?d?Z@d@ZAdAZBdBZCdCZDdDZEdEZFdFZGdGZHdHZIdIZJdJZKdKZLdLZMdMd`dNYZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[d\Z\d]Z]d^Z^d_Z_RS(atTestcCs|j||dS(N(t
assertTrue(tselfttestttestname((s-/usr/local/lib/python2.7/test/test_minidom.pytconfirm8scCs9|j}|j||kdt|t|fdS(Nslooking for %s, found %s(t	wholeTextR'trepr(R$tnodetstt((s-/usr/local/lib/python2.7/test/test_minidom.pytcheckWholeText;s	cCsBttttj}|j|jt|tdS(N(	RRtopenttstfiletreadtunlinkR't
isinstanceR(R$R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestParseFromFile?s
cCsBtt}|j|jd|jjdk|jdS(NtLI(RR/R'tgetElementsByTagNametdocumentElementR1(R$R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestGetElementsByTagNameDscCstd}|j}|jd}|jd}|j|||jt|jdko|jjdko|jd|ko|jjd|ko|jd|ko|jjd|ko|j	|ko|j
|ko|jdkd|jd}|j|d|jt|jdko|jjdko|jd|ko|jjd|ko|jd|ko|jjd|ko|j
|ko|j
|ko|jd	kd|jd
}|j|||jt|jdko|jjdko|jd|ko|jjd|ko|jd|ko|jjd|ko|j|ko|j
|ko|jdkd|jdS(
Ns<doc><foo/></doc>itelementiis<doc><element/><foo/></doc>s0testInsertBefore -- node properly placed in treeis%<doc><element/><foo/><element/></doc>tbaris+<doc><element/><foo/><bar/><element/></doc>(RR6t
childNodest
createElementtinsertBeforeR'tlentlengthRt
firstChildt	lastChildttoxmlRtpreviousSiblingtnextSiblingR1(R$Rtroottelemtnelemtnelem2((s-/usr/local/lib/python2.7/test/test_minidom.pyttestInsertBeforeJsR	
	cCstd}|jd}|jd}|jd}|jd}|jj||j}|j||j||j|||||||fS(Ns<doc/>toriginaltfooR9tbat(RtcreateTextNodeR6tappendChildtcreateDocumentFragment(R$Rtorigtc1tc2tc3tfrag((s-/usr/local/lib/python2.7/test/test_minidom.pyt_create_fragment_test_nodesus


cCs|j\}}}}}}|jj|d|jt|jj||||fkd|j|j|j\}}}}}}|jj|||jt|jj||||fkd|j|jdS(NsinsertBefore(<fragment>, None)sinsertBefore(<fragment>, orig)(RTR6R<RR'ttupleR:R1(R$RRORPRQRRRS((s-/usr/local/lib/python2.7/test/test_minidom.pyttestInsertBeforeFragments


cCsstt}|jj|jd|j|jjdjdk|j|jjdjdk|j	dS(NuHellois#commenttHello(
RR/R6RMt
createCommentR'R:tnodeNametdataR1(R$R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestAppendChilds
  cCst|j\}}}}}}|jj||jt|jj||||fkd|j|jdS(NsappendChild(<fragment>)(RTR6RMR'RUR:R1(R$RRORPRQRRRS((s-/usr/local/lib/python2.7/test/test_minidom.pyttestAppendChildFragments
cCs~|j\}}}}}}|jj|||j|jt|jj|||fkd|j|jdS(NsreplaceChild(<fragment>)(RTR6treplaceChildR1R'RUR:(R$RRORPRQRRRS((s-/usr/local/lib/python2.7/test/test_minidom.pyttestReplaceChildFragments
$
cCst}|jd}|jd}|jtjj|j||j||jtjj|j|||jtjj|j	|||j
}|jtjj|j||jtjj|j||j||j
dS(NR8ttext(RR;RLtassertRaisesRRtHierarchyRequestErrRMR<R]t
attributestsetNamedItemtsetNamedItemNSR1(R$RRER_tnodemap((s-/usr/local/lib/python2.7/test/test_minidom.pyttestLegalChildrens 	
	
cCst}|jd}|j}d|d<|jd}|j|j|kd|j|j|kd|j|jdkd|j|jdkd|j	|j	dS(	NR8R9RJis-NamedNodeMap.__setitem__() sets ownerDocuments,NamedNodeMap.__setitem__() sets ownerElements%NamedNodeMap.__setitem__() sets values)NamedNodeMap.__setitem__() sets nodeValue(
RR;RbRR'RtownerElementtvaluet	nodeValueR1(R$RREtattrsta((s-/usr/local/lib/python2.7/test/test_minidom.pyttestNamedNodeMapSetItems		

cCsUtt}|j||j|jd|j|jdj|jdS(NRJi(RR/R'RMRXR:R1(R$R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestNonZeros

cCstt}|jdS(N(RR/R1(R$R((s-/usr/local/lib/python2.7/test/test_minidom.pyt
testUnlinkscCs=t}|j|jd|j|j|jdS(Ntabc(RRMR;R'R6R1(R$R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestElements	cCstd}|j}|jdd|j|jdkd|jd}|j|j|kd|j|j|jkd|jdS(Ns<abc/>tspamtjam2s<abc spam="jam2"/>ttestAAAs!setAttribute() sets ownerDocuments setAttribute() sets ownerElement(	RR6tsetAttributeR'RAtgetAttributeNodeRRgR1(R$RtelRk((s-/usr/local/lib/python2.7/test/test_minidom.pyRss	cCs_td}|j}|jdd|jdd|j|jdkd|jdS(Ns<abc/>RqtjamRrs<abc spam="jam2"/>ttestAAB(RR6RtR'RAR1(R$RRv((s-/usr/local/lib/python2.7/test/test_minidom.pyRxs	cCsBt}|j|jd}|jdd|j|jddk|j|jdjdk|jdd|j|jddk|j|jdjdk|jt|jdk|jdd|j|jddk|j|jdjdk|jt|jdk|j	dS(NRotdeftghitjkltmnoitnewval(
RRMR;RtR'tgetAttributeRbRhR=R1(R$Rtchild((s-/usr/local/lib/python2.7/test/test_minidom.pyttestAddAttrs	cCst}|j|jd}|jt|jdk|jdd|jt|jdk|jd=|jt|jdk|jdS(NRoiRyRzi(RRMR;R'R=RbRtR1(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestDeleteAttrs	
cCst}|j|jd}|jdd|jt|jdk|jd|jt|jdk|jdS(NRoRyRzii(	RRMR;RtR'R=RbtremoveAttributeR1(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRemoveAttrs	
cCst}|j|jdd}|jddd|jddd|jt|jdk|jdd|jt|jd	k|jdS(
Nshttp://www.python.orgs
python:abcshttp://www.w3.orgsxmlns:pythonspython:abcattrRJitabcattri(	RRMtcreateElementNStsetAttributeNSR'R=RbtremoveAttributeNSR1(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRemoveAttrNS!s	cCst}|j|jd}|jdd|jt|jdk|jd}|j||jt|jdko|jddk|j
dS(NRJRqRwii(RRMR;RtR'R=RbRutremoveAttributeNodeRR1(R$RRR*((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRemoveAttributeNode-s	
cCstd}|j}|jdd|jt|jdk|jdd|jd|jt|jdko|jdjdko|jdjdko|j	ddko|j
djd|jd<|jt|jdkoC|jdjdkoC|jdjdkoC|j	ddkoC|jdj|jdd|jt|jdko|jdjdko|jdjdko|j	ddko|jdjdko|jdjdko|j	ddkd	|jd<|jt|jdko|jdjdko|jdjdko|j	ddko|jdjd	ko|jdjd	ko|j	dd	k|jdS(
Ns<abc/>RqRwitbamthamtspam2itbam2(
RR6RtR'R=RbtsetIdAttributeRhRiR~RutisIdR1(R$RRv((s-/usr/local/lib/python2.7/test/test_minidom.pyttestChangeAttr8sD	


cCsd}t|}|jdd}|jt|dko|djdko|djdko|djdko|djdko|djdk|j	dS(NsZ<foo xmlns:minidom='http://pyxml.sf.net/minidom'>
        <minidom:myelem/>
        </foo>shttp://pyxml.sf.net/minidomtmyelemiiRsminidom:myelem(
RtgetElementsByTagNameNSR'R=tnamespaceURIt	localNametprefixttagNameRYR1(R$tdRtelems((s-/usr/local/lib/python2.7/test/test_minidom.pyttestGetElementsByTagNameNS^s		cCs/|j||}|jt|dkdS(Ni(RR'R=(R$R	tnsuritlnametnodelist((s-/usr/local/lib/python2.7/test/test_minidom.pyt5get_empty_nodelist_from_elements_by_tagName_ns_helpermscCstd}|j|dd|j|dd|j|ddtd}|j|dd|j|dd|j|d	d
dS(Ns<doc/>s"http://xml.python.org/namespaces/at	localnamet*tsplats3<doc xmlns="http://xml.python.org/splat"><e/></doc>shttp://xml.python.org/splats	not-theres#http://somewhere.else.net/not-therete(RR(R$R	((s-/usr/local/lib/python2.7/test/test_minidom.pyt+testGetEmptyNodeListFromElementsByTagNameNSrs




cCsZt}|j|jd}t|}t|}|j||k|jdS(NRo(RRMR;R)tstrR'R1(R$RRvtstring1tstring2((s-/usr/local/lib/python2.7/test/test_minidom.pyttestElementReprAndStrs	cCsZt}|j|jd}t|}t|}|j||k|jdS(Nuabc(RRMR;R)RR'R1(R$RRvRR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestElementReprAndStrUnicodes	cCspt}|j|jdd}t|}t|}|j||k|jd|k|jdS(Nuhttp://www.slashdot.orgu	slash:abcs	slash:abc(RRMRR)RR'R1(R$RRvRR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestElementReprAndStrUnicodeNSs	cCs`t}|j|jd}|jdd}|jt|t|k|jdS(NuabcRoRy(RRMR;RtR'RR)R1(R$RRvR*((s-/usr/local/lib/python2.7/test/test_minidom.pyttestAttributeReprs
	cCs?d}t|}|j}|j|j||kdS(Ns <?xml version="1.0" ?><a b="c"/>(RRAR1R'(R$RRtdomstr((s-/usr/local/lib/python2.7/test/test_minidom.pyttestWriteXMLs

cCsQd}t|}|jdd}|j|j||jddkdS(Ns"<?xml version="1.0" ?>
<a b="c"/>
tnewls
s
(RttoprettyxmlR1R'treplace(R$RRR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestAltNewlines

cCsd}|jtdj|d|jtdj|d|jtdj|d|jtdj|d	|jtd
j|ddS(Ns<?xml version="1.0" ?>
s<B>A</B>s	<B>A</B>
s<C>A<B>A</B></C>s<C>
	A
	<B>A</B>
</C>
s<C><B>A</B>A</C>s<C>
	<B>A</B>
	A
</C>
s<C><B>A</B><B>A</B></C>s<C>
	<B>A</B>
	<B>A</B>
</C>
s<C><B>A</B>A<B>A</B></C>s <C>
	<B>A</B>
	A
	<B>A</B>
</C>
(tassertEqualRR(R$tdecl((s-/usr/local/lib/python2.7/test/test_minidom.pyt test_toprettyxml_with_text_nodesscCsut}|jd}|j|jd|j|jd|j|d}|j|j|ddS(NuelemuTEXTs<?xml version="1.0" ?>
s<elem>
	TEXT
	TEXT
</elem>
(RR;RMRLRR(R$RRER((s-/usr/local/lib/python2.7/test/test_minidom.pyt)test_toprettyxml_with_adjacent_text_nodess	
cCswxpdD]h}t|}t|j}|j|jddjdj|jddjdjqWdS(Ns<B>A</B>s<A><B>C</B></A>tBi(s<B>A</B>s<A><B>C</B></A>(RRRR5R:RA(R$RRtdom2((s-/usr/local/lib/python2.7/test/test_minidom.pyt/test_toprettyxml_preserves_content_of_text_nodes
cCstd}|jj}|j|jdko|jdko|jdko|jtj	ko|j
dko|jot
|jdko|jdko|jdko|jdko|jtjjkdS(Ns<e><?mypi 	
 data 	
 ?></e>tmypisdata 	
 i(RR6R?R'ttargetRZRYtnodeTypeRtPROCESSING_INSTRUCTION_NODERbRt
hasChildNodesR=R:R@RRRRtEMPTY_NAMESPACE(R$Rtpi((s-/usr/local/lib/python2.7/test/test_minidom.pyttestProcessingInstructions
cCsOtd}|jd}|jtjj|j||j|jdS(Ns<doc/>textra(RR;R`RRRaRMR1(R$R	RE((s-/usr/local/lib/python2.7/test/test_minidom.pyttestTooManyDocumentElementss

cCsrtd}|j}|j}|jd}|jd}|j|j||jtj	j
|jddS(Ns<doc a=''/>Rk(RR6RbRutremoveNamedItemR't
isSameNodeR`RRtNotFoundErr(R$R	RRjta1ta2((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRemoveNamedItems		cCs{td}|j}|j}|jdd}|jdd}|j|j||jtj	j
|jdddS(Ns.<doc xmlns:a='http://xml.python.org/' a:b=''/>shttp://xml.python.org/tb(RR6RbtgetAttributeNodeNStremoveNamedItemNSR'RR`RRR(R$R	RRjRR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRemoveNamedItemNSs		cCs
|j}|j}|j}|j}|j|j|j||kdxtt|D]}|j|}	|j|}
|j|	|
k	o|	j|
jko|	j|
jko|	j	|
j	ko|	j
|
j
kd|j|
j|kdqgWdS(Ns(clone of element has same attribute keyss3clone of attribute node has proper attribute valuess'clone of attribute node correctly owned(RbtkeystsortR'trangeR=RRhRiRRRg(R$te1te2R%tattrs1tattrs2tkeys1tkeys2tiRR((s-/usr/local/lib/python2.7/test/test_minidom.pyt!_testCloneElementCopiesAttributess$		

cCstd}|j}|j|}|j||d|r?dpBdd|_|_|jdd|jdd	||fS(
Ns<doc attr='value'><foo/></doc>ttestCloneElementtDeeptShallowtMODIFIEDtattrs	NEW VALUEtaddedtVALUE(RR6t	cloneNodeRRRYRt(R$tdeepRRDtclone((s-/usr/local/lib/python2.7/test/test_minidom.pyt_setupCloneElements	cCsu|jd\}}|jt|jdko`|jjdko`|jdko`|jdkd|jdS(Nis<doc attr="value"/>ttestCloneElementShallow(	RR'R=R:R>t
parentNodeRRAR1(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyRscCsu|jd\}}|jt|jdko`|jjdko`|jdko`|jdkd|jdS(Nis<doc attr="value"><foo/></doc>ttestCloneElementDeep(	RR'R=R:R>RRRAR1(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyR'scCs5td}|jd}|j|dkddS(Ns<?xml version='1.0'?>
<!-- comment --><!DOCTYPE doc [
<!NOTATION notation SYSTEM 'http://xml.python.org/'>
]>
<doc attr='value'/>isFtestCloneDocumentShallow: shallow cloning of documents makes no sense!(RRR'R(R$R	tdoc2((s-/usr/local/lib/python2.7/test/test_minidom.pyttestCloneDocumentShallow0scCs8td}|jd}|j|j|p<|j|d|jt|jt|jkd|j|jjtj	kd|j|jj
j|d|j|jj|jd|jdk	r4|j|jjtj
kd|j|jj
j||j|jj|jndS(	Ns<?xml version='1.0'?>
<!-- comment --><!DOCTYPE doc [
<!NOTATION notation SYSTEM 'http://xml.python.org/'>
]>
<doc attr='value'/>is4testCloneDocumentDeep: document objects not distincts8testCloneDocumentDeep: wrong number of Document childrens:testCloneDocumentDeep: documentElement not an ELEMENT_NODEs@testCloneDocumentDeep: documentElement owner is not new documents;testCloneDocumentDeep: documentElement should not be shareds7testCloneDocumentDeep: doctype not a DOCUMENT_TYPE_NODE(RRR'RR=R:R6RRtELEMENT_NODERRRtDOCUMENT_TYPE_NODE(R$R	R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestCloneDocumentDeep<s""!cCst}|jd}|j|dk	o|j|jko|j|jko|j|jko|j|jkot|j	t|j	ko|j	j
t|j	dkot|jt|jko|jj
t|jdkot|jdkxt
t|j	D]}|j	j
|}|j	j
|}|j|j|o|j|o|j|jko|j|jko|j|jko|j|jko|j|jko|j|jko|j|jkqWxt
t|jD]}|jj
|}|jj
|}|j|j|o|j|o|j|jko|j|jko|j|jkqWdS(Nii(RRR'RRYtnametpublicIdtsystemIdR=RRRR:RRtnotationNameRRR(R$RRRtsetcetsntcn((s-/usr/local/lib/python2.7/test/test_minidom.pyttestCloneDocumentTypeDeepOkUs@	!!cCs5t}|jjd}|j|dkddS(NittestCloneDocumentTypeDeepNotOk(R RRR'R(R$R	R((s-/usr/local/lib/python2.7/test/test_minidom.pyRws	cCst}|jd}|j|dk	o|j|jko|j|jko|j|jko|j|jkot|j	dko|j	j
ddkot|jdko|jj
ddkot|jdkdS(Ni(
RRR'RRYRRRR=RRRR:(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestCloneDocumentTypeShallowOk|s	cCs5t}|jjd}|j|dkddS(Nit!testCloneDocumentTypeShallowNotOk(R RRR'R(R$R	R((s-/usr/local/lib/python2.7/test/test_minidom.pyRs	cCs;td}td}|jtjj|j||dS(Ns<doc/>(RR`RRtNotSupportedErrt
importNode(R$RttestNametdoc1R((s-/usr/local/lib/python2.7/test/test_minidom.pytcheck_import_documentscCs|jdddS(NittestImportDocumentShallow(R(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyRscCs|jdddS(NittestImportDocumentDeep(R(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyRscCs8t}t}|jtjj|j|jddS(Ni(R R
R`RRRRR(R$tsrcR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestImportDocumentTypeShallows		cCs8t}t}|jtjj|j|jddS(Ni(R R
R`RRRRR(R$RR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestImportDocumentTypeDeeps		cCstd}|jjd}|j|d|j|}|j|j||j|j||j|jdk|d|j|j	j|j	|d|j|j
|ddS(Ns<doc attr='value'/>Rs: ownerElement should be Nones: ownerDocument does not matchs.: cloned attribute must have specified == True(RR6RutassertNotEqualRRR'RRgRt	specified(R$RRR	RR((s-/usr/local/lib/python2.7/test/test_minidom.pytcheck_clone_attributescCs|jdddS(NittestCloneAttributeShallow(R(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyRscCs|jdddS(NittestCloneAttributeDeep(R(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyRscCsitd}|j}|j|jtj|j|}|j|j|jkoa|j	|j	kdS(Ns<?target data?><doc/>(
RR?RRRRRR'RRZ(R$RRR	RR((s-/usr/local/lib/python2.7/test/test_minidom.pytcheck_clone_pis	cCs|jdddS(NittestClonePIShallow(R(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyRscCs|jdddS(NittestClonePIDeep(R(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyRsc
Cs`tjjjdj}dd
dY}|}|j}|jd}|jdd||r|jdt	}|j
|jjj
dtjjj}|jjd}	nJtj|d	d|jdt	}WdQXtjjj}|jd}	|j
|j||j
|jd|j
|jd|j|j||j|j|	dS(Ns
            <?xml version="1.0" ?>
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                "http://www.w3.org/TR/html4/strict.dtd"
                [ <!ENTITY smile ":-)"> ]
            >
            <doc>Don't let entities make you frown &smile;</doc>
        tHandlercBseZdZRS(cSs1||_||_||_||_||_dS(N(t	operationtkeyRZRtdst(R$R	R
RZRR((s-/usr/local/lib/python2.7/test/test_minidom.pythandles
				(t__name__t
__module__R(((s-/usr/local/lib/python2.7/test/test_minidom.pyRstsmileR
RZRs%Don't let entities make you frown :-)R((RRRRtstripRRtsetUserDataRtTrueRR6R?R(tUserDataHandlert
NODE_IMPORTEDRt	swap_attrRtNODE_CLONEDR	R
RZtassertIsRR(
R$tclone_documenttdocumentRthandlerRRRR	R((s-/usr/local/lib/python2.7/test/test_minidom.pytcheck_clone_node_entitys,		

cCs|jt|jtdS(N(RtFalseR(R$((s-/usr/local/lib/python2.7/test/test_minidom.pyttestCloneNodeEntitys
cCsOtd}|j}|j|jd|j|jd|jt|jdkok|jjdkd|j|jt|jdko|jjdko|j	|j
ko|j	jdkd|jtd}|j}|j|jd	|j|jt|jd
ko:|jjd
kd|jdS(Ns<doc/>tfirsttsecondistestNormalize -- preparationitfirstsecondstestNormalize -- resulttis*testNormalize -- single empty node removed(
RR6RMRLR'R=R:R>t	normalizeR?R@RZR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyt
testNormalizes,	

	
cCsCtd}|j}|j|jd|j|jd|j|jd|jt|jdko|jjdkd|j	|jt|jdko.|jjdko.|j
jdko.|j
|jk	o.|j
j
|jko.|j
jdko.|jj|j
ko.|jj
dkd	|jdS(
Ns<doc/>RRRis1testNormalizeCombineAndNextSibling -- preparationiR s-testNormalizeCombinedAndNextSibling -- result(RR6RMRLR;R'R=R:R>R"R?RZR@RCRBRR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyt"testNormalizeCombineAndNextSiblings&	
cCstd}|j}|j|jd|j|jd|jt|jdkok|jjdkd|j|jt|jdko|jjdko|j	j
dko|j	|jko|j	jdko|j	jdkd|jdS(Ns<doc/>RR!is1testNormalizeDeleteWithPrevSibling -- preparationis,testNormalizeDeleteWithPrevSibling -- result(RR6RMRLR'R=R:R>R"R?RZR@RCRRBR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyt"testNormalizeDeleteWithPrevSibling+s 	
cCstd}|j}|j|jd|j|jd|jt|jdkok|jjdkd|j|jt|jdko|jjdko|j	j
dko|j	|jko|j	jdko|j	jdkd|jdS(Ns<doc/>R!Ris1testNormalizeDeleteWithNextSibling -- preparationis,testNormalizeDeleteWithNextSibling -- result(RR6RMRLR'R=R:R>R"R?RZR@RCRRBR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyt"testNormalizeDeleteWithNextSibling=s 	
cCs1td}|j}|j|jd|j|jd|j|jd|jt|jdko|jjdkd|j	|jt|jdko|jjdko|j
|jk	o|j
j|jko|j
j
dko|jj
|j
ko|jjdkd|jdS(Ns<doc/>RR!is1testNormalizeDeleteWithTwoSiblings -- preparationis,testNormalizeDeleteWithTwoSiblings -- result(RR6RMR;RLR'R=R:R>R"R?R@RCRBRR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyt)testNormalizeDeleteWithTwoNonTextSiblingsOs$	
cCsEtd}|j}|j|jd|j|jd|j|jd|j|jd|j|jd|jt|jdko|jjdkd|j|jt|jdko0|jjdko0|j	|j
ko0|j	jdko0|j	jdko0|j	jdkd	|jdS(
Ns<doc/>R!Rtfourthis,testNormalizeDeleteAndCombine -- preparationitsecondfourths'testNormalizeDeleteAndCombine -- result(RR6RMRLR'R=R:R>R"R?R@RZRBRRCR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyttestNormalizeDeleteAndCombinecs&	
cCstd}|j}|jdj|jd|jdj|jd|jdjdj|jd|jdj|jd|j|jd|jt|jdko}|jjdko}t|jdjd	ko}|jdjjd	ko}t|jdjdko}|jdjjdko}t|jdjdjd
ko}|jdjdjjd
kd|j|jt|jd
koe|jjd
koet|jdjd
koe|jdjjd
koet|jdjd
koe|jdjjd
koet|jdjdjdkoe|jdjdjjdkd|j|jdjdj	d
ko|jdjdjdj	dko|jdjdj	dkd|j|jdjdj
dko|jdjdj|jdjdko|jdjdjdko|jdjdj
|jdjdko|jdjdj
dko|jdjdj|jdjdko|jdjdjdko|jdjdj
|jdjdkd|j
dS(Ns)<doc><o><i/>t</o><o><o>t2</o>t3</o></doc>iR!txitx2tx3iiistestNormalize2 -- preparations$testNormalize2 -- childNodes lengthsttxtt2x2tt3x3s$testNormalize2 -- joined text fieldss"testNormalize2 -- sibling pointers(RR6R:RMRLR'R=R>R"RZRCRRBR1(R$R	RD((s-/usr/local/lib/python2.7/test/test_minidom.pyttestNormalizeRecursionxsX	$#
##$#cCsJtd}|jjd}|j|jtj|j|jdS(Ns<o>text</o>i(	RR6R:RRRt	TEXT_NODER"R1(R$R	R_((s-/usr/local/lib/python2.7/test/test_minidom.pyttestBug0777884s

cCsStd}|j}d|jd_|j|j|jdjdkddS(Ns<o><i/>t</o>R!iis)Final child's .nextSibling should be None(RR6R:RiR"R'RCR(R$R	R*((s-/usr/local/lib/python2.7/test/test_minidom.pyttestBug1433694s	
cCstd}|j}|j\}}}|j|j|ko|jdko|j|ko|j|ko|jdko|j|kd|jdS(Ns<doc><?pi?>text?<elm/></doc>ttestSiblings(RR6R:R'RCRBRR1(R$R	RDRR_telm((s-/usr/local/lib/python2.7/test/test_minidom.pyR5s	cCstd}|j}|jd}|j\}}|jd}|j|j|ko|j|ko|j|ko|j|ko|j|kd|jdS(Ns3<doc><elm1><elm2/><elm2><elm3/></elm2></elm1></doc>ittestParents(RR6R:R'RR1(R$R	RDtelm1telm2atelm2btelm3((s-/usr/local/lib/python2.7/test/test_minidom.pyR7s		

cCstd}|j}|d}|j|d|jdko|jddko|jjd|jdko|jjd|jdko|jjdjjddkd|jdS(Ns<doc><e/><e/></doc>iistest NodeList.item()(RR:R'RRR1(R$R	tchildrentdocelem((s-/usr/local/lib/python2.7/test/test_minidom.pyttestNodeListItems	
!c	Csddlm}|j}|j|jdi|jd|jdi|jd|jd|jd|jd|j|j}|j	}|j
\}}}|j
d}|j|jdko=|j|ko=|j|ko=|j|ko=|j|ko=|jdko=|jdko=|jdkd|j|j|ko|j|ko|j|ko|j|ko|j|kd|jdS(	Ni(tpulldomR	R_tsubelmistestSAX2DOM - siblingsstestSAX2DOM - parents(txml.domR?tSAX2DOMt
startDocumenttstartElementt
characterst
endElementtendDocumentRR6R:R'RBRRCRR1(	R$R?tsax2domR	RDttext1R8ttext2ttext3((s-/usr/local/lib/python2.7/test/test_minidom.pyttestSAX2DOMs:






		
cCsstd}|j|jdkoK|jddkoK|jddkd|jttd|jdS(	Ns<foo>&#x20ac;</foo>u$<?xml version="1.0" ?><foo>€</foo>sutf-8s4<?xml version="1.0" encoding="utf-8"?><foo>€</foo>siso-8859-15s8<?xml version="1.0" encoding="iso-8859-15"?><foo></foo>s"testEncodings - encoding EURO SIGNs0<franais>Comment a va ? Trs bien ?</franais>(RR'RAR`tUnicodeDecodeErrorR1(R$R	((s-/usr/local/lib/python2.7/test/test_minidom.pyt
testEncodingss	RcBseZdZdZRS(icCs7|j||d||j|ddd|_dS(Ni(RRtcalled(R$R	R
RZRR((s-/usr/local/lib/python2.7/test/test_minidom.pyR%s(R
RROR(((s-/usr/local/lib/python2.7/test/test_minidom.pyR#scCst}|jd}|j|jddk|jddd|j|jddk|jddd|jddd|j|jddk|j|jddk|jddd|j|jddk|j|jddk|j}|jdd||jd}|j|jop|jddkop|jddk|j	|j	|j	dS(NRRJiR9i
i(
RR;R'tgetUserDataRRRRROR1(R$RtnRtc((s-/usr/local/lib/python2.7/test/test_minidom.pyttestUserData*s*	

cCsZ|jtjj|j|ddtd}|jtjj|j|tjjddS(Nshttp://xml.python.org/nss	xmlns:foos<doc/>RJ(R`RRtNamespaceErrt
renameNodeRtWrongDocumentErrR(R$R	R*R((s-/usr/local/lib/python2.7/test/test_minidom.pyt checkRenameNodeSharedConstraintsBs

cCstd}|j}|j}|jd}|j|tjjd}|j|jdko
|j	dko
|j
dko
|jtjjko
|j
dko
|jdko
|jddko
|jdj|o
|dj|o
|jj|o
|jj||j|dd}|j|jdko|j	dko|j
dko|jdko|j
dko|jdko|jddko|jddko|jdj|o|jddj|o|dj|o|d
j||j|dd}|j|jdko,|j	dko,|j
d	ko,|jdko,|j
d
ko,|jdko,|jddko,|jddko,|jddko,|jdddko,|jdj|o,|jdd	j|o,|dj|o,|dj||j|tjjd}|j|jdkoE|j	dkoE|j
dkoE|jtjjkoE|j
dkoE|jdkoE|jddkoE|jddkoE|jddkoE|jddkoE|jdddkoE|jdj|oE|dj||jtjj|j|dd|j|||jdS(Ns<doc a='v'/>RkRtvshttp://xml.python.org/nsRRshttp://xml.python.org/ns2sp:dRtpRtxmlns(shttp://xml.python.org/nsRR(shttp://xml.python.org/ns2R(RR6RbRURRRR'RRYRRRRRhRuRRRgRR`RTRWR1(R$R	REtattrmapR((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRenameAttributeJs		

cCs/td}|j}|j|tjjd}|j|jdko|jdko|j	dko|jtjjko|jdko|j
j||j|dd}|j|jdko|jdko|j	dko|jdko|jdko|j
j||j|dd}|j|jdko|jdko|j	dko|jdko|jdko|j
j||j|tjjd	}|j|jd	ko
|jd	ko
|j	dko
|jtjjko
|jdko
|j
j||j|||jdS(
Ns<doc/>Rkshttp://xml.python.org/nsRshttp://xml.python.org/ns2sp:cRRRYR(RR6RURRRR'RRYRRRRRRRWR1(R$R	RE((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRenameElements@	cCsltjjjjtjjdd}|jd}|jtjj	|j
|tjjd|jdS(NRtcommentRJ(RRRRR
RRRXR`RRUR1(R$R	R*((s-/usr/local/lib/python2.7/test/test_minidom.pyttestRenameOtherscCstd}|j}|jd}|j|jtj|j|d|j|j	d|j|d|j
|jd||j|d|jd}|j||j	d	}|j||j|d|j|d	|j
d
}|j|||}|j|d|j|d	|jdd}|j|||}|j|d|j|d	|j||j|d
|j|d
dS(Ns<doc>a</doc>iRkRtabRRtcabR^RR+tytztcabd(RR6R:RRRR2R-RMRLR<tcreateCDATASectionRXR;R]tcreateProcessingInstructiontremoveChild(R$R	RER_tsplitterRJR+((s-/usr/local/lib/python2.7/test/test_minidom.pyt
testWholeTexts8	



cCsdtd}|j}|j}|j|j|kd|j|||j|j|kddS(Ns<doc><e/></doc>sBefore replaceChild()sAfter replaceChild()(RR6R?R'RR](R$R	RER((s-/usr/local/lib/python2.7/test/test_minidom.pyttestPatch1094164s		cCs2d}|\}}}}}|jd}|j|d|j|d|jt|jdk|\}}}}}|jd}|j|d|j|d|jt|jdk|\}}}}}|jd}|j|d|j|dko*t|jdkdS(	NcSsutd}|j}|j}|j}|j}|j|jd||j|jd||||||fS(Ns<doc>a<e/>d</doc>RRR(RR6R?R@RCR<RLRe(R	RERIRJRh((s-/usr/local/lib/python2.7/test/test_minidom.pytsetups				snew contentRiRaiR!i(treplaceWholeTextR-R'R=R:R(R$RkR	RERIRhRJR_((s-/usr/local/lib/python2.7/test/test_minidom.pyttestReplaceWholeTexts 	
cCstd}|j}|j}|j|jdkoE|jtjj	kdj
}xQ|D]I}|j|}|j}|jt|do|jtjj	kq\WdS(Nsl<!DOCTYPE doc [
  <!ENTITY e1 SYSTEM 'http://xml.python.org/e1'>
  <!ENTITY e2 SYSTEM 'http://xml.python.org/e2'>
  <!ATTLIST doc id   ID       #IMPLIED 
                ref  IDREF    #IMPLIED 
                refs IDREFS   #IMPLIED 
                enum (a|b)    #IMPLIED 
                ent  ENTITY   #IMPLIED 
                ents ENTITIES #IMPLIED 
                nm   NMTOKEN  #IMPLIED 
                nms  NMTOKENS #IMPLIED 
                text CDATA    #IMPLIED 
    >
]><doc id='name' notid='name' text='splat!' enum='b'       ref='name' refs='name name' ent='e1' ents='e1 e2'       nm='123' nms='123 abc' />s+id notid text enum ref refs ent ents nm nmsR(
RR6t
schemaTypeR'RRt	namespaceRRRtsplitRuthasattr(R$R	RER,tnamesRRk((s-/usr/local/lib/python2.7/test/test_minidom.pyttestSchemaTypes			
	cCstd}|j}|jd}|jd}|j|jddko_|jo_|j|jd|j|j|jdo|jo|j|jd|j|j|jdo|j|jdo|jo|j|j	d}d|_
|j||j|jddkoj|j|jdoj|joj|joj|j|j|t
jjd|j|j|jdo|jdS(Ns<doc a1='v' a2='w'/>RRRXtwtan(RR6RuR'tgetElementByIdRRRRtcreateAttributeRhtsetAttributeNodeRURRR(R$R	RRRta3((s-/usr/local/lib/python2.7/test/test_minidom.pyttestSetIdAttribute7s6	

	
	
	

	cCsd}d}td|d|d}|j}|j|d}|j|d}|j|jddko|jo|j|j|d|j|j|jdo|jo|j|j|d|j|j|jdo|j|jd	o|jo|j|j	|d}d|_
|j||j|j|jd	|j|j|j|j|j|j|j|jddk|j|t
jjd
|j|j|jd	o|jdS(Nshttp://xml.python.org/ns1shttp://xml.python.org/ns2s<doc xmlns:ns1='s
' xmlns:ns2='s' ns1:a1='v' ns2:a2='w'/>RRRXRtRu(RR6RR'RvRRtsetIdAttributeNSRtcreateAttributeNSRhRxRURRR(R$tNS1tNS2R	RRRRy((s-/usr/local/lib/python2.7/test/test_minidom.pyttestSetIdAttributeNSVs<	
		
	
cCsd}d}td|d|d}|j}|j|d}|j|d}|j|jddko|jo|j|j||j|j|jdo|jo|j|j||j|j|jdo|j|jd	o|jo|j|j	|d}d|_
|j||j|j|jd	|j|j|j|j|j|j|j|jddk|j|t
jjd
|j|j|jd	o|jdS(Nshttp://xml.python.org/ns1shttp://xml.python.org/ns2s<doc xmlns:ns1='s
' xmlns:ns2='s' ns1:a1='v' ns2:a2='w'/>RRRXRtRu(RR6RR'RvRRtsetIdAttributeNodeRR|RhRxRURRR(R$R}R~R	RRRRy((s-/usr/local/lib/python2.7/test/test_minidom.pyttestSetIdAttributeNodezs<	

	
	
	
cCs||fg}x|r|j\}}|j|j|j|jt|jt|j|j|j|j|j|j||j|j||jtj	krct|j
t|j
t|jt|j|jt|j
t|j
|jt|jt|jxtt|jD]}|jj
|}|jj
|}|j|j|j|j|j|j|j|j|j|j||fqDWxtt|j
D]}|j
j
|}	|j
j
|}
|j|	j|
j|j|	j|
j|j|	j|
j|j|	|
fqWn|jtjkr|j|jj||j|jj|nx>tt|jD]'}|j|j||j|fqWqWdS(N(tpopRRR=R:RYtassertFalseRRRRRRRRRRRRt
DOCUMENT_NODER#R(R$R	Rtstacktn1tn2Rtno1tno2RR((s-/usr/local/lib/python2.7/test/test_minidom.pytassert_recursive_equalsD	"



""cCs_tt}xLttjdD]7}tj||}tj|}|j||q WdS(Ni(RtsampleRtpickletHIGHEST_PROTOCOLtdumpstloadsR(R$R	tprotoR+R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestPickledDocuments
cCs/tt}tj|}|j||dS(N(RRtcopytdeepcopyR(R$R	R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestDeepcopiedDocumentscCs6t}|j|jd|jt|jdS(Nsfoo--bar(R
RMRXR`t
ValueErrorRA(R$R	((s-/usr/local/lib/python2.7/test/test_minidom.pyt(testSerializeCommentNodeWithDoubleHyphens	cCs>td}t|j}|j|jtjjkdS(Ns$<element xmlns=''>
<foo/>
</element>(RRAR'RRRR(R$R	R((s-/usr/local/lib/python2.7/test/test_minidom.pyttestEmptyXMLNSValues((`R
RR'R-R3R7RHRTRVR[R\R^RfRlRmRnRpRsRxRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR#R$R%R&R'R*R1R3R4R5R7R>RLRNRRSRWR\R]R_RiRjRmRsRzRRRRRRR(((s-/usr/local/lib/python2.7/test/test_minidom.pyR!7s				+	
																
			&						
												
									"															/								?						#				M	+	
	$				!		$	$	%			cCstjtdS(N(Rtrun_unittestR!(((s-/usr/local/lib/python2.7/test/test_minidom.pyt	test_mainst__main__(RRRR%RtunittestRARtxml.dom.minidomtxml.parsers.expatRRRRRtfindfileR/RRR
RR tTestCaseR!RR
(((s-/usr/local/lib/python2.7/test/test_minidom.pyt<module>s."			

Zerion Mini Shell 1.0