Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/test/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/test/__pycache__/test_minidom.cpython-33.pyc

�
��fW�c@s�ddlZddlmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZeddd�Ze
dd	�Zd
d�Zdd
�ZGdd�dej�Zdd�Zedkr�e�ndS(iN(urun_unittestufindfile(uparseuNodeuDocumentuparseString(ugetDOMImplementationutest.xmlusubdiruxmltestdatacCst�jdd|�S(Nudoc(ugetDOMImplementationucreateDocumentuNone(udoctype((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucreate_doc_without_doctypesucreate_doc_without_doctypecCs�t�jddd�}g|j_g|j_tjjj	ddd�}|jjj
|�tjjjdddd�}d|_d|_
d|_|jjj
|�|S(	Nudocumy-notationu"http://xml.python.org/notations/myu	my-entityu!http://xml.python.org/entities/myu1.0uutf-8uus-ascii(ugetDOMImplementationucreateDocumentTypeuNoneuentitiesu_sequ	notationsuxmludomuminidomuNotationuappenduEntityuversionuencodinguactualEncoding(udoctypeunotationuentity((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucreate_nonempty_doctypes					ucreate_nonempty_doctypecCsCt�}t|�}||jjd�_||jjd�_|S(Ni(ucreate_nonempty_doctypeucreate_doc_without_doctypeuentitiesuitemu
ownerDocumentu	notations(udoctypeudoc((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucreate_doc_with_doctype%s
	ucreate_doc_with_doctypecBs�|EeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dNdO�Z)dPdQ�Z*dRdS�Z+dTdU�Z,dVdW�Z-dXdY�Z.dZd[�Z/d\d]�Z0d^d_�Z1d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9dpdq�Z:drds�Z;dtdu�Z<dvdw�Z=dxdy�Z>dzd{�Z?d|d}�Z@d~d�ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPGd�d��d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zad�S(�uMinidomTestuTestcCs|j||�dS(N(u
assertTrue(uselfutestutestname((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyuconfirm-suMinidomTest.confirmcCs-|j}|j||kd||f�dS(Nulooking for %r, found %r(u	wholeTextuconfirm(uselfunodeusut((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucheckWholeText0s	uMinidomTest.checkWholeTextcCsEtt��3}t|�}|j�|jt|t��WdQXdS(N(uopenutstfileuparseuunlinkuconfirmu
isinstanceuDocument(uselfufileudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestParseFromFile4s
uMinidomTest.testParseFromFilecCsBtt�}|j|jd�|jjd�k�|j�dS(NuLI(uparseutstfileuconfirmugetElementsByTagNameudocumentElementuunlink(uselfudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestGetElementsByTagName:su$MinidomTest.testGetElementsByTagNamecCs�td�}|j}|jd}|jd�}|j||�|jt|j�dko�|jjdko�|jd|ko�|jjd�|ko�|jd|ko�|jjd�|ko�|j	|ko�|j
|ko�|j�dkd�|jd�}|j|d�|jt|j�dko�|jjdko�|jd|ko�|jjd�|ko�|jd|ko�|jjd�|ko�|j
|ko�|j
|ko�|j�d	kd�|jd
�}|j||�|jt|j�dko�|jjdko�|jd|ko�|jjd�|ko�|jd|ko�|jjd�|ko�|j|ko�|j
|ko�|j�dkd�|j�dS(
Nu<doc><foo/></doc>iuelementiiu<doc><element/><foo/></doc>u0testInsertBefore -- node properly placed in treeiu%<doc><element/><foo/><element/></doc>ubariu+<doc><element/><foo/><bar/><element/></doc>(uparseStringudocumentElementu
childNodesu
createElementuinsertBeforeuconfirmulenulengthuitemu
firstChildu	lastChildutoxmluNoneupreviousSiblingunextSiblinguunlink(uselfudomurootuelemunelemunelem2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestInsertBefore@sR	
	uMinidomTest.testInsertBeforecCs�td�}|jd�}|jd�}|jd�}|jd�}|jj|�|j�}|j|�|j|�|j|�||||||fS(Nu<doc/>uoriginalufooubarubat(uparseStringucreateTextNodeudocumentElementuappendChilducreateDocumentFragment(uselfudomuoriguc1uc2uc3ufrag((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu_create_fragment_test_nodesks


u'MinidomTest._create_fragment_test_nodescCs�|j�\}}}}}}|jj|d�|jt|jj�||||fkd�|j�|j�|j�\}}}}}}|jj||�|jt|jj�||||fkd�|j�|j�dS(NuinsertBefore(<fragment>, None)uinsertBefore(<fragment>, orig)(u_create_fragment_test_nodesudocumentElementuinsertBeforeuNoneuconfirmutupleu
childNodesuunlink(uselfudomuoriguc1uc2uc3ufrag((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestInsertBeforeFragmentxs


u$MinidomTest.testInsertBeforeFragmentcCsstt�}|jj|jd��|j|jjdjdk�|j|jjdjdk�|j	�dS(NuHelloiu#commenti����i����(
uparseutstfileudocumentElementuappendChildu
createCommentuconfirmu
childNodesunodeNameudatauunlink(uselfudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAppendChild�s
  uMinidomTest.testAppendChildcCst|j�\}}}}}}|jj|�|jt|jj�||||fkd�|j�|j�dS(NuappendChild(<fragment>)(u_create_fragment_test_nodesudocumentElementuappendChilduconfirmutupleu
childNodesuunlink(uselfudomuoriguc1uc2uc3ufrag((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAppendChildFragment�s
u#MinidomTest.testAppendChildFragmentcCs~|j�\}}}}}}|jj||�|j�|jt|jj�|||fkd�|j�|j�dS(NureplaceChild(<fragment>)(u_create_fragment_test_nodesudocumentElementureplaceChilduunlinkuconfirmutupleu
childNodes(uselfudomuoriguc1uc2uc3ufrag((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestReplaceChildFragment�s
$
u$MinidomTest.testReplaceChildFragmentcCs�t�}|jd�}|jd�}|jtjj|j|�|j|�|jtjj|j||�|jtjj|j	||�|j
}|jtjj|j|�|jtjj|j|�|j|�|j
�dS(Nuelementutext(uDocumentu
createElementucreateTextNodeuassertRaisesuxmludomuHierarchyRequestErruappendChilduinsertBeforeureplaceChildu
attributesusetNamedItemusetNamedItemNSuunlink(uselfudomuelemutextunodemap((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestLegalChildren�s 	
	
uMinidomTest.testLegalChildrencCs�t�}|jd�}|j}d|d<|jd�}|j|j|kd�|j|j|kd�|j|jdkd�|j|jdkd�|j	�|j	�dS(	Nuelementubarufooiu-NamedNodeMap.__setitem__() sets ownerDocumentu,NamedNodeMap.__setitem__() sets ownerElementu%NamedNodeMap.__setitem__() sets valueu)NamedNodeMap.__setitem__() sets nodeValue(
uDocumentu
createElementu
attributesuitemuconfirmu
ownerDocumentuownerElementuvalueu	nodeValueuunlink(uselfudomuelemuattrsua((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestNamedNodeMapSetItem�s		

u#MinidomTest.testNamedNodeMapSetItemcCsUtt�}|j|�|j|jd��|j|jdj�|j�dS(Nufooii����(uparseutstfileuconfirmuappendChildu
createCommentu
childNodesuunlink(uselfudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestNonZero�s

uMinidomTest.testNonZerocCs:tt�}|j|j�|j�|j|j�dS(N(uparseutstfileu
assertTrueu
childNodesuunlinkuassertFalse(uselfudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu
testUnlink�s
uMinidomTest.testUnlinkc	Cs9tt��}|j|j�WdQX|j|j�dS(N(uparseutstfileu
assertTrueu
childNodesuassertFalse(uselfudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestContext�suMinidomTest.testContextcCs=t�}|j|jd��|j|j�|j�dS(Nuabc(uDocumentuappendChildu
createElementuconfirmudocumentElementuunlink(uselfudom((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestElement�s	uMinidomTest.testElementcCs�td�}|j}|jdd�|j|j�dkd�|jd�}|j|j|kd�|j|j|jkd�|j�dS(Nu<abc/>uspamujam2u<abc spam="jam2"/>utestAAAu!setAttribute() sets ownerDocumentu setAttribute() sets ownerElement(	uparseStringudocumentElementusetAttributeuconfirmutoxmlugetAttributeNodeu
ownerDocumentuownerElementuunlink(uselfudomuelua((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAAA�s	uMinidomTest.testAAAcCs_td�}|j}|jdd�|jdd�|j|j�dkd�|j�dS(Nu<abc/>uspamujamujam2u<abc spam="jam2"/>utestAAB(uparseStringudocumentElementusetAttributeuconfirmutoxmluunlink(uselfudomuel((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAAB�s	uMinidomTest.testAABcCsBt�}|j|jd��}|jdd�|j|jd�dk�|j|jdjdk�|jdd�|j|jd�dk�|j|jdjdk�|jt|j�dk�|jdd�|j|jd�dk�|j|jdjdk�|jt|j�dk�|j	�dS(Nuabcudefughiujklumnoiunewval(
uDocumentuappendChildu
createElementusetAttributeuconfirmugetAttributeu
attributesuvalueulenuunlink(uselfudomuchild((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAddAttr�s	uMinidomTest.testAddAttrcCs�t�}|j|jd��}|jt|j�dk�|jdd�|jt|j�dk�|jd=|jt|j�dk�|j�dS(Nuabciudefughii(uDocumentuappendChildu
createElementuconfirmulenu
attributesusetAttributeuunlink(uselfudomuchild((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestDeleteAttr	s	
uMinidomTest.testDeleteAttrcCs�t�}|j|jd��}|jdd�|jt|j�dk�|jtj	j
|jd�|jd�|jt|j�dk�|j�dS(Nuabcudefughiiufooi(
uDocumentuappendChildu
createElementusetAttributeuconfirmulenu
attributesuassertRaisesuxmludomuNotFoundErruremoveAttributeuunlink(uselfudomuchild((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRemoveAttrs	
uMinidomTest.testRemoveAttrcCs�t�}|j|jdd��}|jddd�|jddd�|jtjj|jdd�|j	t
|j�dk�|jdd�|j	t
|j�d	k�|j�dS(
Nuhttp://www.python.orgu
python:abcuhttp://www.w3.orguxmlns:pythonupython:abcattrufooiuabcattri(
uDocumentuappendChilducreateElementNSusetAttributeNSuassertRaisesuxmludomuNotFoundErruremoveAttributeNSuconfirmulenu
attributesuunlink(uselfudomuchild((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRemoveAttrNSs	
uMinidomTest.testRemoveAttrNScCst�}|j|jd��}|jdd�|jt|j�dk�|jd�}|jt	j
j|jd�|j|�|jt|j�dko�|jd�dk�t�}|j|jd��}|jd�}|jt	j
j|j|�|j�dS(Nufoouspamujamii(uDocumentuappendChildu
createElementusetAttributeuconfirmulenu
attributesugetAttributeNodeuassertRaisesuxmludomuNotFoundErruremoveAttributeNodeuNoneuunlink(uselfudomuchildunodeudom2uchild2unode2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRemoveAttributeNode-s 	
	u#MinidomTest.testRemoveAttributeNodecCsKt�}|j|jd��}|jdd�|j|jd��dS(Nufoouspamujam(uDocumentuappendChildu
createElementusetAttributeuconfirmuhasAttribute(uselfudomuchild((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestHasAttribute?s	uMinidomTest.testHasAttributecCs�td�}|j}|jdd�|jt|j�dk�|jdd�|jd�|jt|j�dko�|jdjdko�|jdjdko�|j	d�dko�|j
d�j�d|jd<|jt|j�dkoC|jdjdkoC|jdjdkoC|j	d�dkoC|jdj�|jdd�|jt|j�dko�|jdjdko�|jdjdko�|j	d�dko�|jdjdko�|jdjdko�|j	d�dk�d	|jd<|jt|j�dko�|jdjdko�|jdjdko�|j	d�dko�|jdjd	ko�|jdjd	ko�|j	d�d	k�|j�dS(
Nu<abc/>uspamujamiubamuhamuspam2iubam2(
uparseStringudocumentElementusetAttributeuconfirmulenu
attributesusetIdAttributeuvalueu	nodeValueugetAttributeugetAttributeNodeuisIduunlink(uselfudomuel((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestChangeAttrEsD	


uMinidomTest.testChangeAttrcCsAt�}|j|jdd��}|j|jd�d�dS(Nuhttp://www.python.orgu
python:abcumissingu(uDocumentuappendChilducreateElementNSuassertEqualugetAttribute(uselfudomuchild((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestGetAttributeks	uMinidomTest.testGetAttributecCs�t�}|j|jdd��}|jddd�|j|jdd�d�|j|jdd�d�|j|jd��}|j|jdd	�d�dS(
Nuhttp://www.python.orgu
python:abcuhttp://www.w3.orguxmlns:pythonupythonuotheruuabcumissing(uDocumentuappendChilducreateElementNSusetAttributeNSuassertEqualugetAttributeNSu
createElement(uselfudomuchilduchild2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestGetAttributeNSqs	uMinidomTest.testGetAttributeNScCs�d}t|�}|jdd�}|jt|�dko�|djdko�|djdko�|djdko�|djdko�|djdk�|j	�dS(NuZ<foo xmlns:minidom='http://pyxml.sf.net/minidom'>
        <minidom:myelem/>
        </foo>uhttp://pyxml.sf.net/minidomumyelemiiuminidomuminidom:myelem(
uparseStringugetElementsByTagNameNSuconfirmulenunamespaceURIu	localNameuprefixutagNameunodeNameuunlink(uselfududomuelems((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestGetElementsByTagNameNSs		u&MinidomTest.testGetElementsByTagNameNScCs/|j||�}|jt|�dk�dS(Ni(ugetElementsByTagNameNSuconfirmulen(uselfudocunsuriulnameunodelist((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu5get_empty_nodelist_from_elements_by_tagName_ns_helper�suAMinidomTest.get_empty_nodelist_from_elements_by_tagName_ns_helpercCs�td�}|j|dd�|j|dd�|j|dd�td�}|j|dd�|j|dd�|j|d	d
�dS(Nu<doc/>u"http://xml.python.org/namespaces/au	localnameu*usplatu3<doc xmlns="http://xml.python.org/splat"><e/></doc>uhttp://xml.python.org/splatu	not-thereu#http://somewhere.else.net/not-thereue(uparseStringu5get_empty_nodelist_from_elements_by_tagName_ns_helper(uselfudoc((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu+testGetEmptyNodeListFromElementsByTagNameNS�s




u7MinidomTest.testGetEmptyNodeListFromElementsByTagNameNScCsZt�}|j|jd��}t|�}t|�}|j||k�|j�dS(Nuabc(uDocumentuappendChildu
createElementureprustruconfirmuunlink(uselfudomuelustring1ustring2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestElementReprAndStr�s	u!MinidomTest.testElementReprAndStrcCsZt�}|j|jd��}t|�}t|�}|j||k�|j�dS(Nuabc(uDocumentuappendChildu
createElementureprustruconfirmuunlink(uselfudomuelustring1ustring2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestElementReprAndStrUnicode�s	u(MinidomTest.testElementReprAndStrUnicodecCspt�}|j|jdd��}t|�}t|�}|j||k�|jd|k�|j�dS(Nuhttp://www.slashdot.orgu	slash:abc(uDocumentuappendChilducreateElementNSureprustruconfirmuunlink(uselfudomuelustring1ustring2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestElementReprAndStrUnicodeNS�s	u*MinidomTest.testElementReprAndStrUnicodeNScCs`t�}|j|jd��}|jdd�}|jt|�t|�k�|j�dS(Nuabcudef(uDocumentuappendChildu
createElementusetAttributeuconfirmustrurepruunlink(uselfudomuelunode((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAttributeRepr�s
	uMinidomTest.testAttributeReprcCs?d}t|�}|j�}|j�|j||k�dS(Nu <?xml version="1.0" ?><a b="c"/>(uparseStringutoxmluunlinkuconfirm(uselfustrudomudomstr((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestWriteXML�s

uMinidomTest.testWriteXMLcCsQd}t|�}|jdd�}|j�|j||jdd�k�dS(Nu"<?xml version="1.0" ?>
<a b="c"/>
unewlu
u
(uparseStringutoprettyxmluunlinkuconfirmureplace(uselfustrudomudomstr((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestAltNewline�s

uMinidomTest.testAltNewlinecCs�d}|jtd�j�|d�|jtd�j�|d�|jtd�j�|d�|jtd�j�|d	�|jtd
�j�|d�dS(Nu<?xml version="1.0" ?>
u<B>A</B>u	<B>A</B>
u<C>A<B>A</B></C>u<C>
	A
	<B>A</B>
</C>
u<C><B>A</B>A</C>u<C>
	<B>A</B>
	A
</C>
u<C><B>A</B><B>A</B></C>u<C>
	<B>A</B>
	<B>A</B>
</C>
u<C><B>A</B>A<B>A</B></C>u <C>
	<B>A</B>
	A
	<B>A</B>
</C>
(uassertEqualuparseStringutoprettyxml(uselfudecl((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu test_toprettyxml_with_text_nodes�su,MinidomTest.test_toprettyxml_with_text_nodescCsut�}|jd�}|j|jd��|j|jd��|j|�d}|j|j�|d�dS(NuelemuTEXTu<?xml version="1.0" ?>
u<elem>
	TEXT
	TEXT
</elem>
(uDocumentu
createElementuappendChilducreateTextNodeuassertEqualutoprettyxml(uselfudomuelemudecl((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu)test_toprettyxml_with_adjacent_text_nodes�s	
u5MinidomTest.test_toprettyxml_with_adjacent_text_nodescCswxpdD]h}t|�}t|j��}|j|jd�djdj�|jd�djdj��qWdS(Nu<B>A</B>u<A><B>C</B></A>uBi(u<B>A</B>u<A><B>C</B></A>(uparseStringutoprettyxmluassertEqualugetElementsByTagNameu
childNodesutoxml(uselfustrudomudom2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu/test_toprettyxml_preserves_content_of_text_node�s
u;MinidomTest.test_toprettyxml_preserves_content_of_text_nodec
Cs�td�}|jj}|j|jdko�|jdko�|jdko�|jtj	ko�|j
dko�|j�o�t
|j�dko�|jdko�|jdko�|jdko�|jtjjk�dS(Nu<e><?mypi 	
 data 	
 ?></e>umypiudata 	
 i(uparseStringudocumentElementu
firstChilduconfirmutargetudataunodeNameunodeTypeuNodeuPROCESSING_INSTRUCTION_NODEu
attributesuNoneu
hasChildNodesulenu
childNodesu	lastChildu	localNameunamespaceURIuxmludomuEMPTY_NAMESPACE(uselfudomupi((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestProcessingInstruction�s
u%MinidomTest.testProcessingInstructioncCsOtd�}|jd�}|jtjj|j|�|j�|j�dS(Nu<doc/>uextra(uparseStringu
createElementuassertRaisesuxmludomuHierarchyRequestErruappendChilduunlink(uselfudocuelem((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestTooManyDocumentElementss

u'MinidomTest.testTooManyDocumentElementscCsrtd�}|j}|j}|jd�}|jd�}|j|j|��|jtj	j
|jd�dS(Nu<doc a=''/>ua(uparseStringudocumentElementu
attributesugetAttributeNodeuremoveNamedItemuconfirmu
isSameNodeuassertRaisesuxmludomuNotFoundErr(uselfudocueuattrsua1ua2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRemoveNamedItems		uMinidomTest.testRemoveNamedItemcCs{td�}|j}|j}|jdd�}|jdd�}|j|j|��|jtj	j
|jdd�dS(Nu.<doc xmlns:a='http://xml.python.org/' a:b=''/>uhttp://xml.python.org/ub(uparseStringudocumentElementu
attributesugetAttributeNodeNSuremoveNamedItemNSuconfirmu
isSameNodeuassertRaisesuxmludomuNotFoundErr(uselfudocueuattrsua1ua2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRemoveNamedItemNSs		u!MinidomTest.testRemoveNamedItemNScCsTtd�}|j}|j|j��td�}|j}|j|j��dS(Nu<doc><foo/></doc>u<doc/>(uparseStringudocumentElementu
assertTrueu
hasChildNodesuassertFalse(uselfudomudocudom2udoc2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestHasChildNodess		uMinidomTest.testHasChildNodescCs|j}|j}t|j��}t|j��}|j�|j�|j||kd�x�tt|��D]�}|j|�}	|j|�}
|j|	|
k	o�|	j|
jko�|	j	|
j	ko�|	j
|
j
ko�|	j|
jkd�|j|
j|kd�qsWdS(Nu(clone of element has same attribute keysu3clone of attribute node has proper attribute valuesu'clone of attribute node correctly owned(
u
attributesulistukeysusortuconfirmurangeulenuitemuvalueu	nodeValueunamespaceURIu	localNameuownerElement(uselfue1ue2utestuattrs1uattrs2ukeys1ukeys2uiua1ua2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu!_testCloneElementCopiesAttributes's$		

u-MinidomTest._testCloneElementCopiesAttributescCs�td�}|j}|j|�}|j||d|r?dpBd�d|_|_|jdd�|jdd	�||fS(
Nu<doc attr='value'><foo/></doc>utestCloneElementuDeepuShallowuMODIFIEDuattru	NEW VALUEuaddeduVALUE(uparseStringudocumentElementu	cloneNodeu!_testCloneElementCopiesAttributesutagNameunodeNameusetAttribute(uselfudeepudomurootuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu_setupCloneElement;s	uMinidomTest._setupCloneElementcCsu|jd�\}}|jt|j�dko`|jjdko`|jdko`|j�dkd�|j�dS(Niu<doc attr="value"/>utestCloneElementShallow(	u_setupCloneElementuconfirmulenu
childNodesulengthu
parentNodeuNoneutoxmluunlink(uselfudomuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneElementShallowGsu#MinidomTest.testCloneElementShallowcCsu|jd�\}}|jt|j�dko`|jjdko`|jdko`|j�dkd�|j�dS(Niu<doc attr="value"><foo/></doc>utestCloneElementDeep(	u_setupCloneElementuconfirmulenu
childNodesulengthu
parentNodeuNoneutoxmluunlink(uselfudomuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneElementDeepPsu MinidomTest.testCloneElementDeepcCs5td�}|jd�}|j|dkd�dS(Nu�<?xml version='1.0'?>
<!-- comment --><!DOCTYPE doc [
<!NOTATION notation SYSTEM 'http://xml.python.org/'>
]>
<doc attr='value'/>iuFtestCloneDocumentShallow: shallow cloning of documents makes no sense!(uparseStringu	cloneNodeuconfirmuNone(uselfudocudoc2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneDocumentShallowYsu$MinidomTest.testCloneDocumentShallowcCs8td�}|jd�}|j|j|�p<|j|�d�|jt|j�t|j�kd�|j|jjtj	kd�|j|jj
j|�d�|j|jj|j�d�|jdk	r4|j|jjtj
kd�|j|jj
j|��|j|jj|j��ndS(	Nu�<?xml version='1.0'?>
<!-- comment --><!DOCTYPE doc [
<!NOTATION notation SYSTEM 'http://xml.python.org/'>
]>
<doc attr='value'/>iu4testCloneDocumentDeep: document objects not distinctu8testCloneDocumentDeep: wrong number of Document childrenu:testCloneDocumentDeep: documentElement not an ELEMENT_NODEu@testCloneDocumentDeep: documentElement owner is not new documentu;testCloneDocumentDeep: documentElement should not be sharedu7testCloneDocumentDeep: doctype not a DOCUMENT_TYPE_NODE(uparseStringu	cloneNodeuconfirmu
isSameNodeulenu
childNodesudocumentElementunodeTypeuNodeuELEMENT_NODEu
ownerDocumentudoctypeuNoneuDOCUMENT_TYPE_NODE(uselfudocudoc2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneDocumentDeepes""!u!MinidomTest.testCloneDocumentDeepcCs�t�}|jd�}|j|dk	o|j|jko|j|jko|j|jko|j|jkot|j	�t|j	�ko|j	j
t|j	��dkot|j�t|j�ko|jj
t|j��dkot|j�dk�x�t
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|jk�qWx�t
t|j��D]�}|jj
|�}|jj
|�}|j|j|�o�|j|�o�|j|jko�|j|jko�|j|jk�qWdS(Nii(ucreate_nonempty_doctypeu	cloneNodeuconfirmuNoneunodeNameunameupublicIdusystemIdulenuentitiesuitemu	notationsu
childNodesurangeu
isSameNodeunotationNameuencodinguactualEncodinguversion(uselfudoctypeucloneuiuseuceusnucn((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneDocumentTypeDeepOk~s@	!!u'MinidomTest.testCloneDocumentTypeDeepOkcCs5t�}|jjd�}|j|dkd�dS(NiutestCloneDocumentTypeDeepNotOk(ucreate_doc_with_doctypeudoctypeu	cloneNodeuconfirmuNone(uselfudocuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneDocumentTypeDeepNotOk�s	u*MinidomTest.testCloneDocumentTypeDeepNotOkcCs�t�}|jd�}|j|dk	o�|j|jko�|j|jko�|j|jko�|j|jko�t|j	�dko�|j	j
d�dko�t|j�dko�|jj
d�dko�t|j�dk�dS(Ni(
ucreate_nonempty_doctypeu	cloneNodeuconfirmuNoneunodeNameunameupublicIdusystemIdulenuentitiesuitemu	notationsu
childNodes(uselfudoctypeuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneDocumentTypeShallowOk�s	u*MinidomTest.testCloneDocumentTypeShallowOkcCs5t�}|jjd�}|j|dkd�dS(Niu!testCloneDocumentTypeShallowNotOk(ucreate_doc_with_doctypeudoctypeu	cloneNodeuconfirmuNone(uselfudocuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu!testCloneDocumentTypeShallowNotOk�s	u-MinidomTest.testCloneDocumentTypeShallowNotOkcCs;td�}td�}|jtjj|j||�dS(Nu<doc/>(uparseStringuassertRaisesuxmludomuNotSupportedErru
importNode(uselfudeeputestNameudoc1udoc2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucheck_import_document�su!MinidomTest.check_import_documentcCs|jdd�dS(NiutestImportDocumentShallow(ucheck_import_document(uself((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestImportDocumentShallow�su%MinidomTest.testImportDocumentShallowcCs|jdd�dS(NiutestImportDocumentDeep(ucheck_import_document(uself((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestImportDocumentDeep�su"MinidomTest.testImportDocumentDeepcCs8t�}t�}|jtjj|j|jd�dS(Ni(ucreate_doc_with_doctypeucreate_doc_without_doctypeuassertRaisesuxmludomuNotSupportedErru
importNodeudoctype(uselfusrcutarget((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestImportDocumentTypeShallow�s		u)MinidomTest.testImportDocumentTypeShallowcCs8t�}t�}|jtjj|j|jd�dS(Ni(ucreate_doc_with_doctypeucreate_doc_without_doctypeuassertRaisesuxmludomuNotSupportedErru
importNodeudoctype(uselfusrcutarget((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestImportDocumentTypeDeep�s		u&MinidomTest.testImportDocumentTypeDeepcCs�td�}|jjd�}|j|d�|j|�}|j|j|��|j|j|��|j|jdk|d�|j|j	j|j	�|d�|j|j
|d�dS(Nu<doc attr='value'/>uattru: ownerElement should be Noneu: ownerDocument does not matchu.: cloned attribute must have specified == True(uparseStringudocumentElementugetAttributeNodeuassertNotEqualuNoneu	cloneNodeuconfirmu
isSameNodeuownerElementu
ownerDocumentu	specified(uselfudeeputestNameudocuattruclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucheck_clone_attribute�su!MinidomTest.check_clone_attributecCs|jdd�dS(NiutestCloneAttributeShallow(ucheck_clone_attribute(uself((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneAttributeShallow�su%MinidomTest.testCloneAttributeShallowcCs|jdd�dS(NiutestCloneAttributeDeep(ucheck_clone_attribute(uself((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestCloneAttributeDeep�su"MinidomTest.testCloneAttributeDeepcCsitd�}|j}|j|jtj�|j|�}|j|j|jkoa|j	|j	k�dS(Nu<?target data?><doc/>(
uparseStringu
firstChilduassertEqualunodeTypeuNodeuPROCESSING_INSTRUCTION_NODEu	cloneNodeuconfirmutargetudata(uselfudeeputestNameudocupiuclone((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyucheck_clone_pi�s	uMinidomTest.check_clone_picCs|jdd�dS(NiutestClonePIShallow(ucheck_clone_pi(uself((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestClonePIShallow�suMinidomTest.testClonePIShallowcCs|jdd�dS(NiutestClonePIDeep(ucheck_clone_pi(uself((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestClonePIDeep�suMinidomTest.testClonePIDeepcCsOtd�}|j}|j|jd��|j|jd��|jt|j�dkok|jjdkd�|j�|jt|j�dko�|jjdko�|j	|j
ko�|j	jdkd�|j�td�}|j}|j|jd	��|j�|jt|j�d
ko:|jjd
kd�|j�dS(Nu<doc/>ufirstusecondiutestNormalize -- preparationiufirstsecondutestNormalize -- resultuiu*testNormalize -- single empty node removed(
uparseStringudocumentElementuappendChilducreateTextNodeuconfirmulenu
childNodesulengthu	normalizeu
firstChildu	lastChildudatauunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu
testNormalize�s,	

	
uMinidomTest.testNormalizecCsCtd�}|j}|j|jd��|j|jd��|j|jd��|jt|j�dko�|jjdkd�|j	�|jt|j�dko.|jjdko.|j
jdko.|j
|jk	o.|j
j
|jko.|j
jdko.|jj|j
ko.|jj
dkd	�|j�dS(
Nu<doc/>ufirstuseconduiiu1testNormalizeCombineAndNextSibling -- preparationiufirstsecondu-testNormalizeCombinedAndNextSibling -- result(uparseStringudocumentElementuappendChilducreateTextNodeu
createElementuconfirmulenu
childNodesulengthu	normalizeu
firstChildudatau	lastChildunextSiblingupreviousSiblinguNoneuunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu"testNormalizeCombineAndNextSiblings&	
u.MinidomTest.testNormalizeCombineAndNextSiblingc	Cstd�}|j}|j|jd��|j|jd��|jt|j�dkok|jjdkd�|j�|jt|j�dko�|jjdko�|j	j
dko�|j	|jko�|j	jdko�|j	jdkd�|j�dS(Nu<doc/>ufirstuiu1testNormalizeDeleteWithPrevSibling -- preparationiu,testNormalizeDeleteWithPrevSibling -- result(uparseStringudocumentElementuappendChilducreateTextNodeuconfirmulenu
childNodesulengthu	normalizeu
firstChildudatau	lastChildunextSiblinguNoneupreviousSiblinguunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu"testNormalizeDeleteWithPrevSibling!s 	
u.MinidomTest.testNormalizeDeleteWithPrevSiblingc	Cstd�}|j}|j|jd��|j|jd��|jt|j�dkok|jjdkd�|j�|jt|j�dko�|jjdko�|j	j
dko�|j	|jko�|j	jdko�|j	jdkd�|j�dS(Nu<doc/>uusecondiu1testNormalizeDeleteWithNextSibling -- preparationiu,testNormalizeDeleteWithNextSibling -- result(uparseStringudocumentElementuappendChilducreateTextNodeuconfirmulenu
childNodesulengthu	normalizeu
firstChildudatau	lastChildunextSiblinguNoneupreviousSiblinguunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu"testNormalizeDeleteWithNextSibling3s 	
u.MinidomTest.testNormalizeDeleteWithNextSiblingc
Cs1td�}|j}|j|jd��|j|jd��|j|jd��|jt|j�dko�|jjdkd�|j	�|jt|j�dko|jjdko|j
|jk	o|j
j|jko|j
j
dko|jj
|j
ko|jjdkd�|j�dS(Nu<doc/>uiuiu1testNormalizeDeleteWithTwoSiblings -- preparationiu,testNormalizeDeleteWithTwoSiblings -- result(uparseStringudocumentElementuappendChildu
createElementucreateTextNodeuconfirmulenu
childNodesulengthu	normalizeu
firstChildu	lastChildunextSiblingupreviousSiblinguNoneuunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu)testNormalizeDeleteWithTwoNonTextSiblingsEs$	
u5MinidomTest.testNormalizeDeleteWithTwoNonTextSiblingsc	CsEtd�}|j}|j|jd��|j|jd��|j|jd��|j|jd��|j|jd��|jt|j�dko�|jjdkd�|j�|jt|j�dko0|jjdko0|j	|j
ko0|j	jdko0|j	jdko0|j	jdkd	�|j�dS(
Nu<doc/>uusecondufourthiu,testNormalizeDeleteAndCombine -- preparationiusecondfourthu'testNormalizeDeleteAndCombine -- result(uparseStringudocumentElementuappendChilducreateTextNodeuconfirmulenu
childNodesulengthu	normalizeu
firstChildu	lastChildudataupreviousSiblinguNoneunextSiblinguunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestNormalizeDeleteAndCombineYs&	
u)MinidomTest.testNormalizeDeleteAndCombinecCstd�}|j}|jdj|jd��|jdj|jd��|jdjdj|jd��|jdj|jd��|j|jd��|jt|j�dko}|jjdko}t|jdj�d	ko}|jdjjd	ko}t|jdj�dko}|jdjjdko}t|jdjdj�d
ko}|jdjdjjd
kd�|j�|jt|j�d
koe|jjd
koet|jdj�d
koe|jdjjd
koet|jdj�d
koe|jdjjd
koet|jdjdj�dkoe|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(Nu)<doc><o><i/>t</o><o><o>t2</o>t3</o></doc>iuuxiux2ux3iiiutestNormalize2 -- preparationu$testNormalize2 -- childNodes lengthsutxut2x2ut3x3u$testNormalize2 -- joined text fieldsu"testNormalize2 -- sibling pointers(uparseStringudocumentElementu
childNodesuappendChilducreateTextNodeuconfirmulenulengthu	normalizeudataunextSiblinguNoneupreviousSiblinguunlink(uselfudocuroot((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestNormalizeRecursionnsX	$#
##$#u"MinidomTest.testNormalizeRecursioncCsJtd�}|jjd}|j|jtj�|j�|j�dS(Nu<o>text</o>i(	uparseStringudocumentElementu
childNodesuassertEqualunodeTypeuNodeu	TEXT_NODEu	normalizeuunlink(uselfudocutext((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestBug0777884�s

uMinidomTest.testBug0777884cCsStd�}|j}d|jd_|j�|j|jdjdkd�dS(Nu<o><i/>t</o>uiu)Final child's .nextSibling should be Nonei����(uparseStringudocumentElementu
childNodesu	nodeValueu	normalizeuconfirmunextSiblinguNone(uselfudocunode((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestBug1433694�s	
uMinidomTest.testBug1433694cCs�td�}|j}|j\}}}|j|j|ko�|jdko�|j|ko�|j|ko�|jdko�|j|kd�|j�dS(Nu<doc><?pi?>text?<elm/></doc>utestSiblings(uparseStringudocumentElementu
childNodesuconfirmunextSiblingupreviousSiblinguNoneuunlink(uselfudocurootupiutextuelm((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestSiblings�s	uMinidomTest.testSiblingscCs�td�}|j}|jd}|j\}}|jd}|j|j|ko�|j|ko�|j|ko�|j|ko�|j|kd�|j�dS(Nu3<doc><elm1><elm2/><elm2><elm3/></elm2></elm1></doc>iutestParents(uparseStringudocumentElementu
childNodesuconfirmu
parentNodeuunlink(uselfudocurootuelm1uelm2auelm2buelm3((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestParents�s		

uMinidomTest.testParentscCs�td�}|j}|d}|j|d|jd�ko�|jd�dko�|jjd�|jdko�|jjd�|jdko�|jjd�jjd�dkd�|j�dS(Nu<doc><e/><e/></doc>iiutest NodeList.item()(uparseStringu
childNodesuconfirmuitemuNoneuunlink(uselfudocuchildrenudocelem((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestNodeListItem�s	
!uMinidomTest.testNodeListItemcCs�td�}|j|j�d�|j|jd�d�|j|jd�d�|j|jd�d�|j|jd	�d
jd	��|jttd�|j�dS(Nu<foo>&#x20ac;</foo>u$<?xml version="1.0" ?><foo>€</foo>uutf-8s4<?xml version="1.0" encoding="utf-8"?><foo>€</foo>uiso-8859-15s8<?xml version="1.0" encoding="iso-8859-15"?><foo>�</foo>uus-asciis;<?xml version="1.0" encoding="us-ascii"?><foo>&#8364;</foo>uutf-16u5<?xml version="1.0" encoding="utf-16"?><foo>€</foo>s0<fran�ais>Comment �a va ? Tr�s bien ?</fran�ais>(uparseStringuassertEqualutoxmluencodeuassertRaisesuUnicodeDecodeErroruunlink(uselfudoc((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu
testEncodings�s
uMinidomTest.testEncodingscBs&|EeZdZdZdd�ZdS(uMinidomTest.UserDataHandlericCs7|j||d|�|j|dd�d|_dS(Ni(usetUserDatauNoneucalled(uselfu	operationukeyudatausrcudst((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyuhandle�su"MinidomTest.UserDataHandler.handleN(u__name__u
__module__u__qualname__ucalleduhandle(u
__locals__((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyuUserDataHandler�suUserDataHandlercCs�t�}|jd�}|j|jd�dk�|jddd�|j|jd�dk�|jddd�|jddd�|j|jd�dk�|j|jd�dk�|jddd�|j|jd�dk�|j|jd�dk�|j�}|jdd|�|jd�}|j|jop|jd�dkop|jd�dk�|j	�|j	�|j	�dS(Nueufooiubari
i(
uDocumentu
createElementuconfirmugetUserDatauNoneusetUserDatauUserDataHandleru	cloneNodeucalleduunlink(uselfudomunuhandleruc((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestUserDatas*	

uMinidomTest.testUserDatacCsZ|jtjj|j|dd�td�}|jtjj|j|tjjd�dS(Nuhttp://xml.python.org/nsu	xmlns:foou<doc/>ufoo(uassertRaisesuxmludomuNamespaceErru
renameNodeuparseStringuWrongDocumentErruEMPTY_NAMESPACE(uselfudocunodeudoc2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu checkRenameNodeSharedConstraintss

u,MinidomTest.checkRenameNodeSharedConstraintsc4Cs�td�}|j}|j}|jd}|j|tjjd�}|j|jdko
|j	dko
|j
dko
|jtjjko
|j
dko
|jdko
|jd�dko
|jd�j|�o
|dj|�o
|jj|�o
|jj|��|j|dd�}|j|jdko|j	dko|j
dko|jdko|j
dko|jdko|jd�dko|jd�dko|jd�j|�o|jdd�j|�o|dj|�o|d
j|��|j|dd�}|j|jdko,|j	dko,|j
d	ko,|jdko,|j
d
ko,|jdko,|jd�dko,|jd�dko,|jd�dko,|jdd�dko,|jd�j|�o,|jdd	�j|�o,|dj|�o,|dj|��|j|tjjd�}|j|jdkoE|j	dkoE|j
dkoE|jtjjkoE|j
dkoE|jdkoE|jd�dkoE|jd�dkoE|jd�dkoE|jd�dkoE|jdd�dkoE|jd�j|�oE|dj|��|jtjj|j|dd�|j||�|j�dS(Nu<doc a='v'/>uaubuvuhttp://xml.python.org/nsucuhttp://xml.python.org/ns2up:dudupueuxmlns(uhttp://xml.python.org/nsuc(uhttp://xml.python.org/ns2ud(uparseStringudocumentElementu
attributesu
renameNodeuxmludomuEMPTY_NAMESPACEuconfirmunameunodeNameu	localNameuNoneunamespaceURIuprefixuvalueugetAttributeNodeu
isSameNodeu
ownerDocumentuownerElementugetAttributeNodeNSuassertRaisesuNamespaceErru checkRenameNodeSharedConstraintsuunlink(uselfudocuelemuattrmapuattr((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRenameAttribute"s�		

uMinidomTest.testRenameAttributecCs/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||�|j�dS(
Nu<doc/>uauhttp://xml.python.org/nsubuhttp://xml.python.org/ns2up:cucupud(uparseStringudocumentElementu
renameNodeuxmludomuEMPTY_NAMESPACEuconfirmutagNameunodeNameu	localNameuNoneunamespaceURIuprefixu
ownerDocumentu
isSameNodeu checkRenameNodeSharedConstraintsuunlink(uselfudocuelem((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRenameElementos@	uMinidomTest.testRenameElementcCsltjjj�jtjjdd�}|jd�}|jtjj	|j
|tjjd�|j�dS(Nueucommentufoo(uxmludomuminidomugetDOMImplementationucreateDocumentuEMPTY_NAMESPACEuNoneu
createCommentuassertRaisesuNotSupportedErru
renameNodeuunlink(uselfudocunode((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestRenameOther�suMinidomTest.testRenameOthercCs�td�}|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(Nu<doc>a</doc>iuaubuabucucabucommentuduxuyuzucabd(uparseStringudocumentElementu
childNodesuassertEqualunodeTypeuNodeu	TEXT_NODEucheckWholeTextuappendChilducreateTextNodeuinsertBeforeucreateCDATASectionu
createCommentu
createElementureplaceChilducreateProcessingInstructionuremoveChild(uselfudocuelemutextusplitterutext2ux((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu
testWholeText�s8	



uMinidomTest.testWholeTextcCsdtd�}|j}|j}|j|j|kd�|j||�|j|j|kd�dS(Nu<doc><e/></doc>uBefore replaceChild()uAfter replaceChild()(uparseStringudocumentElementu
firstChilduconfirmu
parentNodeureplaceChild(uselfudocuelemue((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestPatch1094164�s		uMinidomTest.testPatch1094164cCs5dd�}|�\}}}}}|jd�}|j|d�|j|d�|jt|j�dk�|�\}}}}}|jd�}|j|d�|j|d�|jt|j�dk�|�\}}}}}|jd�}|j|d�|j|dko-t|j�d	k�dS(
NcSsutd�}|j}|j}|j}|j}|j|jd�|�|j|jd�|�|||||fS(Nu<doc>a<e/>d</doc>ubuc(uparseStringudocumentElementu
firstChildu	lastChildunextSiblinguinsertBeforeucreateTextNodeucreateCDATASection(udocuelemutext1utext2usplitter((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyusetup�s				u/MinidomTest.testReplaceWholeText.<locals>.setupunew contentudiucabiui(ureplaceWholeTextucheckWholeTextuconfirmulenu
childNodesuNone(uselfusetupudocuelemutext1usplitterutext2utext((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestReplaceWholeText�s 
u MinidomTest.testReplaceWholeTextcCs�td�}|j}|j}|j|jdkoE|jtjj	k�dj
�}xQ|D]I}|j|�}|j}|jt|d�o�|jtjj	k�q\WdS(Nul<!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' />u+id notid text enum ref refs ent ents nm nmsuname(
uparseStringudocumentElementu
schemaTypeuconfirmunameuNoneu	namespaceuxmludomuEMPTY_NAMESPACEusplitugetAttributeNodeuhasattr(uselfudocuelemutunamesunameua((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestSchemaType�s			
	uMinidomTest.testSchemaTypecCs�td�}|j}|jd�}|jd�}|j|jd�dko_|jo_|j�|jd�|j|j|jd��o�|jo�|j�|jd�|j|j|jd��o�|j|jd��o�|jo�|j�|j	d�}d|_
|j|�|j|jd�dkoj|j|jd��oj|joj|joj|j�|j|t
jjd�|j|j|jd��o�|j�dS(Nu<doc a1='v' a2='w'/>ua1ua2uvuwuan(uparseStringudocumentElementugetAttributeNodeuconfirmugetElementByIduNoneuisIdusetIdAttributeu
isSameNodeucreateAttributeuvalueusetAttributeNodeu
renameNodeuxmludomuEMPTY_NAMESPACE(uselfudocueua1ua2ua3((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestSetIdAttributes6	

	
	
	

	uMinidomTest.testSetIdAttributecCs�d}d}td|d|d�}|j}|j|d�}|j|d�}|j|jd�dko�|jo�|j�|j|d�|j|j|jd��o�|jo�|j�|j|d�|j|j|jd��o|j|jd	��o|jo|j�|j	|d�}d|_
|j|�|j|j|jd	���|j|j�|j|j�|j|j�|j|jd�dk�|j|t
jjd
�|j|j|jd	��o�|j�dS(Nuhttp://xml.python.org/ns1uhttp://xml.python.org/ns2u<doc xmlns:ns1='u
' xmlns:ns2='u' ns1:a1='v' ns2:a2='w'/>ua1ua2uvuwuan(uparseStringudocumentElementugetAttributeNodeNSuconfirmugetElementByIduNoneuisIdusetIdAttributeNSu
isSameNodeucreateAttributeNSuvalueusetAttributeNodeu
renameNodeuxmludomuEMPTY_NAMESPACE(uselfuNS1uNS2udocueua1ua2ua3((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestSetIdAttributeNS.s<	
		
	
u MinidomTest.testSetIdAttributeNScCs�d}d}td|d|d�}|j}|j|d�}|j|d�}|j|jd�dko�|jo�|j�|j|�|j|j|jd��o�|jo�|j�|j|�|j|j|jd��o|j|jd	��o|jo|j�|j	|d�}d|_
|j|�|j|j|jd	���|j|j�|j|j�|j|j�|j|jd�dk�|j|t
jjd
�|j|j|jd	��o�|j�dS(Nuhttp://xml.python.org/ns1uhttp://xml.python.org/ns2u<doc xmlns:ns1='u
' xmlns:ns2='u' ns1:a1='v' ns2:a2='w'/>ua1ua2uvuwuan(uparseStringudocumentElementugetAttributeNodeNSuconfirmugetElementByIduNoneuisIdusetIdAttributeNodeu
isSameNodeucreateAttributeNSuvalueusetAttributeNodeu
renameNodeuxmludomuEMPTY_NAMESPACE(uselfuNS1uNS2udocueua1ua2ua3((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestSetIdAttributeNodeRs<	

	
	
	
u"MinidomTest.testSetIdAttributeNodecCs�td�}tj|�}tj|�}||fg}x�|r�|j�\}}|j|j|jko�t|j�t|j�ko�|j	|j	ko�|j
|�o�|j
|��|jtjkrqt|j
�t|j
�t|j�t|j�|jt|j
�t|j
�koBt|j�t|j�k�x�tt|j��D]z}|jj|�}|jj|�}	|j|j|	jko�|j|	jko�|j|	jk�|j||	f�q\Wx�tt|j
��D]z}|j
j|�}
|j
j|�}|j|
j|jkoS|
j|jkoS|
j|jk�|j|
|f�q�Wn|jtjkr�|j|jj
|�o�|jj
|��nx>tt|j��D]'}|j|j||j|f�q�Wq<WdS(Nu<?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>(uparseStringupickleudumpsuloadsupopuconfirmunodeTypeulenu
childNodesunodeNameu
isSameNodeuNodeuDOCUMENT_TYPE_NODEuentitiesu	notationsurangeuitemunameupublicIdusystemIduappendunotationNameu
DOCUMENT_NODEu
ownerDocument(uselfudocusudoc2ustackun1un2uiuno1uno2ue1ue2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestPickledDocumentvsJ	



$uMinidomTest.testPickledDocumentcCs6t�}|j|jd��|jt|j�dS(Nufoo--bar(ucreate_doc_without_doctypeuappendChildu
createCommentuassertRaisesu
ValueErrorutoxml(uselfudoc((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu(testSerializeCommentNodeWithDoubleHyphen�s	u4MinidomTest.testSerializeCommentNodeWithDoubleHyphencCs>td�}t|j��}|j|jtjjk�dS(Nu$<element xmlns=''>
<foo/>
</element>(uparseStringutoxmluconfirmunamespaceURIuxmludomuEMPTY_NAMESPACE(uselfudocudoc2((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestEmptyXMLNSValue�suMinidomTest.testEmptyXMLNSValuecCs�tt�}|jjd�d}|jtjj|j|�t	|j
�}|j|j
d�t	|j
�}|j||dk�dS(NuTITLEii(uparseutstfileudocumentElementugetElementsByTagNameuassertRaisesuxmludomuNotFoundErruremoveChildulenu
childNodesu
assertTrue(uselfudocu	title_tagunum_children_beforeunum_children_after((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyutestDocRemoveChild�suMinidomTest.testDocRemoveChildN(bu__name__u
__module__u__qualname__uconfirmucheckWholeTextutestParseFromFileutestGetElementsByTagNameutestInsertBeforeu_create_fragment_test_nodesutestInsertBeforeFragmentutestAppendChildutestAppendChildFragmentutestReplaceChildFragmentutestLegalChildrenutestNamedNodeMapSetItemutestNonZerou
testUnlinkutestContextutestElementutestAAAutestAAButestAddAttrutestDeleteAttrutestRemoveAttrutestRemoveAttrNSutestRemoveAttributeNodeutestHasAttributeutestChangeAttrutestGetAttributeutestGetAttributeNSutestGetElementsByTagNameNSu5get_empty_nodelist_from_elements_by_tagName_ns_helperu+testGetEmptyNodeListFromElementsByTagNameNSutestElementReprAndStrutestElementReprAndStrUnicodeutestElementReprAndStrUnicodeNSutestAttributeReprutestWriteXMLutestAltNewlineu test_toprettyxml_with_text_nodesu)test_toprettyxml_with_adjacent_text_nodesu/test_toprettyxml_preserves_content_of_text_nodeutestProcessingInstructionutestTooManyDocumentElementsutestRemoveNamedItemutestRemoveNamedItemNSutestHasChildNodesu!_testCloneElementCopiesAttributesu_setupCloneElementutestCloneElementShallowutestCloneElementDeeputestCloneDocumentShallowutestCloneDocumentDeeputestCloneDocumentTypeDeepOkutestCloneDocumentTypeDeepNotOkutestCloneDocumentTypeShallowOku!testCloneDocumentTypeShallowNotOkucheck_import_documentutestImportDocumentShallowutestImportDocumentDeeputestImportDocumentTypeShallowutestImportDocumentTypeDeepucheck_clone_attributeutestCloneAttributeShallowutestCloneAttributeDeepucheck_clone_piutestClonePIShallowutestClonePIDeepu
testNormalizeu"testNormalizeCombineAndNextSiblingu"testNormalizeDeleteWithPrevSiblingu"testNormalizeDeleteWithNextSiblingu)testNormalizeDeleteWithTwoNonTextSiblingsutestNormalizeDeleteAndCombineutestNormalizeRecursionutestBug0777884utestBug1433694utestSiblingsutestParentsutestNodeListItemu
testEncodingsuUserDataHandlerutestUserDatau checkRenameNodeSharedConstraintsutestRenameAttributeutestRenameElementutestRenameOtheru
testWholeTextutestPatch1094164utestReplaceWholeTextutestSchemaTypeutestSetIdAttributeutestSetIdAttributeNSutestSetIdAttributeNodeutestPickledDocumentu(testSerializeCommentNodeWithDoubleHyphenutestEmptyXMLNSValueutestDocRemoveChild(u
__locals__((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyuMinidomTest,s�+
		&
		
		"?M+
$	!$$.uMinidomTestcCstt�dS(N(urun_unittestuMinidomTest(((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu	test_main�su	test_mainu__main__(upickleutest.supporturun_unittestufindfileuunittestuxml.dom.minidomuxmluparseuNodeuDocumentuparseStringugetDOMImplementationutstfileuNoneucreate_doc_without_doctypeucreate_nonempty_doctypeucreate_doc_with_doctypeuTestCaseuMinidomTestu	test_mainu__name__(((u6/opt/alt/python33/lib64/python3.3/test/test_minidom.pyu<module>s$"������