Your IP : 216.73.216.52


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_minidom.cpython-35.opt-2.pyc



���]���@s�ddlZddlZddlmZddlZddlZddlmZmZm	Z	m
Z
ddlmZeddd�ZdZ
dd	d
�Zdd�Zd
d�ZGdd�dej�Zedkr�ej�dS)�N)�findfile)�parse�Node�Document�parseString)�getDOMImplementationztest.xmlZsubdirZxmltestdataa<?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>cCst�jdd|�S)N�doc)r�createDocument)�doctype�r�1/opt/alt/python35/lib64/python3.5/test_minidom.py�create_doc_without_doctypesr
cCs�t�jddd�}g|j_g|j_tjjjddd�}|jjj	|�tjjj
dddd�}d|_d|_d|_
|jjj	|�|S)	Nrzmy-notationz"http://xml.python.org/notations/myz	my-entityz!http://xml.python.org/entities/myz1.0zutf-8zus-ascii)rZcreateDocumentType�entitiesZ_seq�	notations�xml�dom�minidomZNotation�appendZEntity�version�encoding�actualEncoding)r
ZnotationZentityrrr�create_nonempty_doctypes					rcCsCt�}t|�}||jjd�_||jjd�_|S)Nr)rr
r�item�
ownerDocumentr)r
rrrr�create_doc_with_doctype-s
	rc@sJeZdZddd�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��ZPd�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�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��Zpd�d��ZqGd�d��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��Zd�d��Z�d�d��Z�dd�Z�dd�Z�dd�Z�dd�Z�dd	�Z�d
S(�MinidomTestZTestcCs|j||�dS)N)�
assertTrue)�self�testZtestnamerrr�confirm5szMinidomTest.confirmcCs-|j}|j||kd||f�dS)Nzlooking for %r, found %r)Z	wholeTextr)r�node�s�trrr�checkWholeText8s	zMinidomTest.checkWholeTextc!Cs�t�}|j|j�|jt��|jt|dd��WdQRX|jt��t|dd�WdQRX|jt��|jt|dd��WdQRX|j|j�|jtj�|jt��|jttdd��WdQRXdS)N�asyncTF)r�assertFalseZasync_ZassertWarns�DeprecationWarning�getattr�setattrr)rrrrr�testDocumentAsyncAttr<s	  z!MinidomTest.testDocumentAsyncAttrcCsIttd��3}t|�}|j�|jt|t��WdQRXdS)N�rb)�open�tstfiler�unlinkr�
isinstancer)r�filerrrr�testParseFromBinaryFileKs
z#MinidomTest.testParseFromBinaryFilecCsOttddd��3}t|�}|j�|jt|t��WdQRXdS)N�rrz
iso-8859-1)r+r,rr-rr.r)rr/rrrr�testParseFromTextFileQs
z!MinidomTest.testParseFromTextFilecCsBtt�}|j|jd�|jjd�k�|j�dS)NZLI)rr,r�getElementsByTagName�documentElementr-)rrrrr�testGetElementsByTagNameWsz$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)
Nz<doc><foo/></doc>r�element��z<doc><element/><foo/></doc>z0testInsertBefore -- node properly placed in tree�z%<doc><element/><foo/><element/></doc>�bar�z+<doc><element/><foo/><bar/><element/></doc>)rr4�
childNodes�
createElement�insertBeforer�len�lengthr�
firstChild�	lastChild�toxml�previousSibling�nextSiblingr-)rr�root�elemZnelemZnelem2rrr�testInsertBefore]sR	
	zMinidomTest.testInsertBeforecCs�td�}|jd�}|jd�}|jd�}|jd�}|jj|�|j�}|j|�|j|�|j|�||||||fS)Nz<doc/>Zoriginal�foor:Zbat)r�createTextNoder4�appendChildZcreateDocumentFragment)rr�orig�c1�c2�c3�fragrrr�_create_fragment_test_nodes�s


z'MinidomTest._create_fragment_test_nodescCs�|j�\}}}}}}|jj|d�|jt|jj�||||fkd�|j�|j�|j�\}}}}}}|jj||�|jt|jj�||||fkd�|j�|j�dS)NzinsertBefore(<fragment>, None)zinsertBefore(<fragment>, orig))rQr4r>r�tupler<r-)rrrLrMrNrOrPrrr�testInsertBeforeFragment�s


z$MinidomTest.testInsertBeforeFragmentcCsstt�}|jj|jd��|j|jjdjdk�|j|jjdjdk�|j	�dS)NZHellor8z#comment���rT)
rr,r4rK�
createCommentrr<�nodeName�datar-)rrrrr�testAppendChild�s
  zMinidomTest.testAppendChildcCst|j�\}}}}}}|jj|�|jt|jj�||||fkd�|j�|j�dS)NzappendChild(<fragment>))rQr4rKrrRr<r-)rrrLrMrNrOrPrrr�testAppendChildFragment�s
z#MinidomTest.testAppendChildFragmentcCs~|j�\}}}}}}|jj||�|j�|jt|jj�|||fkd�|j�|j�dS)NzreplaceChild(<fragment>))rQr4�replaceChildr-rrRr<)rrrLrMrNrOrPrrr�testReplaceChildFragment�s
$
z$MinidomTest.testReplaceChildFragmentcCs�t�}|jd�}|jd�}|jtjj|j|�|j|�|jtjj|j||�|jtjj|j	||�|j
}|jtjj|j|�|jtjj|j|�|j|�|j
�dS)Nr6�text)rr=rJ�assertRaisesrr�HierarchyRequestErrrKr>rZ�
attributesZsetNamedItemZsetNamedItemNSr-)rrrGr\Znodemaprrr�testLegalChildren�s 	
	
zMinidomTest.testLegalChildrencCs�t�}|jd�}|j}d|d<|jd�}|j|j|kd�|j|j|kd�|j|jdkd�|j|jdkd�|j	�|j	�dS)	Nr6r:rIrz-NamedNodeMap.__setitem__() sets ownerDocumentz,NamedNodeMap.__setitem__() sets ownerElementz%NamedNodeMap.__setitem__() sets valuez)NamedNodeMap.__setitem__() sets nodeValue)
rr=r_rrr�ownerElement�value�	nodeValuer-)rrrG�attrs�arrr�testNamedNodeMapSetItem�s		

z#MinidomTest.testNamedNodeMapSetItemcCsUtt�}|j|�|j|jd��|j|jdj�|j�dS)NrIr8rT)rr,rrKrUr<r-)rrrrr�testNonZero�s

zMinidomTest.testNonZerocCs:tt�}|j|j�|j�|j|j�dS)N)rr,rr<r-r%)rrrrr�
testUnlink�s
zMinidomTest.testUnlinkc	Cs:tt��}|j|j�WdQRX|j|j�dS)N)rr,rr<r%)rrrrr�testContext�szMinidomTest.testContextcCs=t�}|j|jd��|j|j�|j�dS)N�abc)rrKr=rr4r-)rrrrr�testElement�s	zMinidomTest.testElementcCs�td�}|j}|jdd�|j|j�dkd�|jd�}|j|j|kd�|j|j|jkd�|j�dS)Nz<abc/>�spam�jam2z<abc spam="jam2"/>�testAAAz!setAttribute() sets ownerDocumentz setAttribute() sets ownerElement)	rr4�setAttributerrC�getAttributeNoderrar-)rr�elrerrrrn�s	zMinidomTest.testAAAcCs_td�}|j}|jdd�|jdd�|j|j�dkd�|j�dS)Nz<abc/>rl�jamrmz<abc spam="jam2"/>�testAAB)rr4rorrCr-)rrrqrrrrs	s	zMinidomTest.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)Nrj�def�ghiZjklZmnor7Znewval)
rrKr=ror�getAttributer_rbr?r-)rr�childrrr�testAddAttrs	zMinidomTest.testAddAttrcCs�t�}|j|jd��}|jt|j�dk�|jdd�|jt|j�dk�|jd=|jt|j�dk�|j�dS)Nrjrrtrur8)rrKr=rr?r_ror-)rrrwrrr�testDeleteAttr&s	
zMinidomTest.testDeleteAttrcCs�t�}|j|jd��}|jdd�|jt|j�dk�|jtj	j
|jd�|jd�|jt|j�dk�|j�dS)Nrjrtrur8rIr)
rrKr=rorr?r_r]rr�NotFoundErrZremoveAttributer-)rrrwrrr�testRemoveAttr1s	
zMinidomTest.testRemoveAttrcCs�t�}|j|jdd��}|jddd�|jddd�|jtjj|jdd�|j	t
|j�dk�|jdd�|j	t
|j�d	k�|j�dS)
Nzhttp://www.python.orgz
python:abczhttp://www.w3.orgzxmlns:pythonzpython:abcattrrIr7Zabcattrr8)
rrK�createElementNS�setAttributeNSr]rrrzZremoveAttributeNSrr?r_r-)rrrwrrr�testRemoveAttrNS<s	
zMinidomTest.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)NrIrlrrr8r)rrKr=rorr?r_rpr]rrrzZremoveAttributeNoder-)rrrwr �dom2�child2Znode2rrr�testRemoveAttributeNodeJs 	
	z#MinidomTest.testRemoveAttributeNodecCsKt�}|j|jd��}|jdd�|j|jd��dS)NrIrlrr)rrKr=rorZhasAttribute)rrrwrrr�testHasAttribute\s	zMinidomTest.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)
Nz<abc/>rlrrr8ZbamZhamZspam2r7Zbam2)
rr4rorr?r_�setIdAttributerbrcrvrp�isIdr-)rrrqrrr�testChangeAttrbsD	


zMinidomTest.testChangeAttrcCsdS)Nr)rrrr�testGetAttrList�szMinidomTest.testGetAttrListcCsdS)Nr)rrrr�testGetAttrValues�szMinidomTest.testGetAttrValuescCsdS)Nr)rrrr�testGetAttrLength�szMinidomTest.testGetAttrLengthcCsAt�}|j|jdd��}|j|jd�d�dS)Nzhttp://www.python.orgz
python:abc�missing�)rrKr|�assertEqualrv)rrrwrrr�testGetAttribute�s	zMinidomTest.testGetAttributecCs�t�}|j|jdd��}|jddd�|j|jdd�d�|j|jdd�d�|j|jd��}|j|jdd	�d�dS)
Nzhttp://www.python.orgz
python:abczhttp://www.w3.orgzxmlns:python�python�otherr�rjr�)rrKr|r}r�ZgetAttributeNSr=)rrrwr�rrr�testGetAttributeNS�s	zMinidomTest.testGetAttributeNScCsdS)Nr)rrrr�testGetAttributeNode�sz MinidomTest.testGetAttributeNodecCs�d}t|�}|jdd�}|jt|�dko�|djdko�|djdko�|djdko�|djdko�|djdk�|j	�dS)NzZ<foo xmlns:minidom='http://pyxml.sf.net/minidom'>
        <minidom:myelem/>
        </foo>zhttp://pyxml.sf.net/minidomZmyelemr8rrzminidom:myelem)
r�getElementsByTagNameNSrr?�namespaceURI�	localName�prefix�tagNamerVr-)r�drZelemsrrr�testGetElementsByTagNameNS�s		z&MinidomTest.testGetElementsByTagNameNScCs/|j||�}|jt|�dk�dS)Nr)r�rr?)rrZnsuriZlnameZnodelistrrr�5get_empty_nodelist_from_elements_by_tagName_ns_helper�szAMinidomTest.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)Nz<doc/>z"http://xml.python.org/namespaces/aZ	localname�*Zsplatz3<doc xmlns="http://xml.python.org/splat"><e/></doc>zhttp://xml.python.org/splatz	not-therez#http://somewhere.else.net/not-there�e)rr�)rrrrr�+testGetEmptyNodeListFromElementsByTagNameNS�s




z7MinidomTest.testGetEmptyNodeListFromElementsByTagNameNScCsZt�}|j|jd��}t|�}t|�}|j||k�|j�dS)Nrj)rrKr=�repr�strrr-)rrrq�string1�string2rrr�testElementReprAndStr�s	z!MinidomTest.testElementReprAndStrcCsZt�}|j|jd��}t|�}t|�}|j||k�|j�dS)Nrj)rrKr=r�r�rr-)rrrqr�r�rrr�testElementReprAndStrUnicode�s	z(MinidomTest.testElementReprAndStrUnicodecCspt�}|j|jdd��}t|�}t|�}|j||k�|jd|k�|j�dS)Nzhttp://www.slashdot.orgz	slash:abc)rrKr|r�r�rr-)rrrqr�r�rrr�testElementReprAndStrUnicodeNS�s	z*MinidomTest.testElementReprAndStrUnicodeNScCs`t�}|j|jd��}|jdd�}|jt|�t|�k�|j�dS)Nrjrt)rrKr=rorr�r�r-)rrrqr rrr�testAttributeRepr�s
	zMinidomTest.testAttributeReprcCsdS)Nr)rrrr�testTextNodeRepr�szMinidomTest.testTextNodeReprcCs?d}t|�}|j�}|j�|j||k�dS)Nz <?xml version="1.0" ?><a b="c"/>)rrCr-r)rr�r�domstrrrr�testWriteXML�s

zMinidomTest.testWriteXMLcCsQd}t|�}|jdd�}|j�|j||jdd�k�dS)Nz"<?xml version="1.0" ?>
<a b="c"/>
Znewlz
�
)r�toprettyxmlr-r�replace)rr�rr�rrr�testAltNewline�s

zMinidomTest.testAltNewlinecCs�d}|jtd�j�|d�|jtd�j�|d�|jtd�j�|d�|jtd�j�|d	�|jtd
�j�|d�dS)Nz<?xml version="1.0" ?>
z<B>A</B>z	<B>A</B>
z<C>A<B>A</B></C>z<C>
	A
	<B>A</B>
</C>
z<C><B>A</B>A</C>z<C>
	<B>A</B>
	A
</C>
z<C><B>A</B><B>A</B></C>z<C>
	<B>A</B>
	<B>A</B>
</C>
z<C><B>A</B>A<B>A</B></C>z <C>
	<B>A</B>
	A
	<B>A</B>
</C>
)r�rr�)r�declrrr� test_toprettyxml_with_text_nodes�sz,MinidomTest.test_toprettyxml_with_text_nodescCsut�}|jd�}|j|jd��|j|jd��|j|�d}|j|j�|d�dS)NrGZTEXTz<?xml version="1.0" ?>
z<elem>
	TEXT
	TEXT
</elem>
)rr=rKrJr�r�)rrrGr�rrr�)test_toprettyxml_with_adjacent_text_nodess	
z5MinidomTest.test_toprettyxml_with_adjacent_text_nodescCswxpdD]h}t|�}t|j��}|j|jd�djdj�|jd�djdj��qWdS)N�<B>A</B>�<A><B>C</B></A>�Br)r�r�)rr�r�r3r<rC)rr�rrrrr�/test_toprettyxml_preserves_content_of_text_nodes
z;MinidomTest.test_toprettyxml_preserves_content_of_text_nodecCs�td�}|jj}|j|jdko�|jdko�|jdko�|jtj	ko�|j
dko�|j�o�t|j
�dko�|jdko�|jdko�|jdko�|jtjjk�dS)Nz<e><?mypi 	
 data 	
 ?></e>Zmypizdata 	
 r)rr4rAr�targetrWrV�nodeTyper�PROCESSING_INSTRUCTION_NODEr_�
hasChildNodesr?r<rBr�r�rr�EMPTY_NAMESPACE)rr�pirrr�testProcessingInstructions
z%MinidomTest.testProcessingInstructioncCsdS)Nr)rrrr�testProcessingInstructionRepr.sz)MinidomTest.testProcessingInstructionReprcCsdS)Nr)rrrr�testTextRepr0szMinidomTest.testTextReprcCsdS)Nr)rrrr�
testWriteText2szMinidomTest.testWriteTextcCsdS)Nr)rrrr�testDocumentElement4szMinidomTest.testDocumentElementcCsOtd�}|jd�}|jtjj|j|�|j�|j�dS)Nz<doc/>�extra)rr=r]rrr^rKr-)rrrGrrr�testTooManyDocumentElements6s

z'MinidomTest.testTooManyDocumentElementscCsdS)Nr)rrrr�testCreateElementNS>szMinidomTest.testCreateElementNScCsdS)Nr)rrrr�testCreateAttributeNS@sz!MinidomTest.testCreateAttributeNScCsdS)Nr)rrrr�	testParseBszMinidomTest.testParsecCsdS)Nr)rrrr�testParseStringDszMinidomTest.testParseStringcCsdS)Nr)rrrr�testCommentFszMinidomTest.testCommentcCsdS)Nr)rrrr�testAttrListItemHszMinidomTest.testAttrListItemcCsdS)Nr)rrrr�testAttrListItemsJszMinidomTest.testAttrListItemscCsdS)Nr)rrrr�testAttrListItemNSLszMinidomTest.testAttrListItemNScCsdS)Nr)rrrr�testAttrListKeysNszMinidomTest.testAttrListKeyscCsdS)Nr)rrrr�testAttrListKeysNSPszMinidomTest.testAttrListKeysNScCsrtd�}|j}|j}|jd�}|jd�}|j|j|��|jtj	j
|jd�dS)Nz<doc a=''/>re)rr4r_rpZremoveNamedItemr�
isSameNoder]rrrz)rrr�rd�a1�a2rrr�testRemoveNamedItemRs		zMinidomTest.testRemoveNamedItemcCs{td�}|j}|j}|jdd�}|jdd�}|j|j|��|jtj	j
|jdd�dS)Nz.<doc xmlns:a='http://xml.python.org/' a:b=''/>zhttp://xml.python.org/�b)rr4r_�getAttributeNodeNSZremoveNamedItemNSrr�r]rrrz)rrr�rdr�r�rrr�testRemoveNamedItemNS[s		z!MinidomTest.testRemoveNamedItemNScCsdS)Nr)rrrr�testAttrListValueseszMinidomTest.testAttrListValuescCsdS)Nr)rrrr�testAttrListLengthgszMinidomTest.testAttrListLengthcCsdS)Nr)rrrr�testAttrList__getitem__isz#MinidomTest.testAttrList__getitem__cCsdS)Nr)rrrr�testAttrList__setitem__ksz#MinidomTest.testAttrList__setitem__cCsdS)Nr)rrrr�testSetAttrValueandNodeValuemsz(MinidomTest.testSetAttrValueandNodeValuecCsdS)Nr)rrrr�testParseElementoszMinidomTest.testParseElementcCsdS)Nr)rrrr�testParseAttributesqszMinidomTest.testParseAttributescCsdS)Nr)rrrr�testParseElementNamespacesssz&MinidomTest.testParseElementNamespacescCsdS)Nr)rrrr�testParseAttributeNamespacesusz(MinidomTest.testParseAttributeNamespacescCsdS)Nr)rrrr�testParseProcessingInstructionswsz+MinidomTest.testParseProcessingInstructionscCsdS)Nr)rrrr�testChildNodesyszMinidomTest.testChildNodescCsdS)Nr)rrrr�testFirstChild{szMinidomTest.testFirstChildcCsTtd�}|j}|j|j��td�}|j}|j|j��dS)Nz<doc><foo/></doc>z<doc/>)rr4rr�r%)rrrr�doc2rrr�testHasChildNodes}s		zMinidomTest.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)Nz(clone of element has same attribute keysz3clone of attribute node has proper attribute valuesz'clone of attribute node correctly owned)
r_�list�keys�sortr�ranger?rrbrcr�r�ra)r�e1�e2rZattrs1Zattrs2Zkeys1Zkeys2�ir�r�rrr�!_testCloneElementCopiesAttributes�s$		

z-MinidomTest._testCloneElementCopiesAttributescCs�td�}|j}|j|�}|j||d|r?dpBd�d|_|_|jdd�|jdd	�||fS)
Nz<doc attr='value'><foo/></doc>ZtestCloneElementZDeepZShallowZMODIFIED�attrz	NEW VALUEZaddedZVALUE)rr4�	cloneNoder�r�rVro)r�deeprrF�clonerrr�_setupCloneElement�s	zMinidomTest._setupCloneElementcCsu|jd�\}}|jt|j�dko`|jjdko`|jdko`|j�dkd�|j�dS)Nrz<doc attr="value"/>�testCloneElementShallow)r�rr?r<r@�
parentNoderCr-)rrr�rrrr��sz#MinidomTest.testCloneElementShallowcCsu|jd�\}}|jt|j�dko`|jjdko`|jdko`|j�dkd�|j�dS)Nr8z<doc attr="value"><foo/></doc>�testCloneElementDeep)r�rr?r<r@r�rCr-)rrr�rrrr��sz MinidomTest.testCloneElementDeepcCs5td�}|jd�}|j|dkd�dS)Nz�<?xml version='1.0'?>
<!-- comment --><!DOCTYPE doc [
<!NOTATION notation SYSTEM 'http://xml.python.org/'>
]>
<doc attr='value'/>rzFtestCloneDocumentShallow: shallow cloning of documents makes no sense!)rr�r)rrr�rrr�testCloneDocumentShallow�sz$MinidomTest.testCloneDocumentShallowcCs5td�}|jd�}|j|j|�p<|j|�d�|jt|j�t|j�kd�|j|jjtj	kd�|j|jj
j|�d�|j|jj|j�d�|jdk	r1|j|jjtjkd�|j|jj
j|��|j|jj|j��dS)	Nz�<?xml version='1.0'?>
<!-- comment --><!DOCTYPE doc [
<!NOTATION notation SYSTEM 'http://xml.python.org/'>
]>
<doc attr='value'/>r8z4testCloneDocumentDeep: document objects not distinctz8testCloneDocumentDeep: wrong number of Document childrenz:testCloneDocumentDeep: documentElement not an ELEMENT_NODEz@testCloneDocumentDeep: documentElement owner is not new documentz;testCloneDocumentDeep: documentElement should not be sharedz7testCloneDocumentDeep: doctype not a DOCUMENT_TYPE_NODE)
rr�rr�r?r<r4r�rZELEMENT_NODErr
�DOCUMENT_TYPE_NODE)rrr�rrr�testCloneDocumentDeep�s""!z!MinidomTest.testCloneDocumentDeepcCs�t�}|jd�}|j|dk	o|j|jko|j|jko|j|jko|j|jkot|j�t|j�ko|jj	t|j��dkot|j
�t|j
�ko|j
j	t|j
��dkot|j�dk�x�tt|j��D]�}|jj	|�}|jj	|�}|j|j
|�o�|j
|�o�|j|jko�|j|jko�|j|jko�|j|jko�|j|jko�|j|jko�|j|jk�qWx�tt|j
��D]�}|j
j	|�}|j
j	|�}|j|j
|�o�|j
|�o�|j|jko�|j|jko�|j|jk�qWdS)Nr8r)rr�rrV�name�publicId�systemIdr?rrrr<r�r��notationNamerrr)rr
r�r�ZseZceZsnZcnrrr�testCloneDocumentTypeDeepOk�s@	!!z'MinidomTest.testCloneDocumentTypeDeepOkcCs5t�}|jjd�}|j|dkd�dS)Nr8�testCloneDocumentTypeDeepNotOk)rr
r�r)rrr�rrrr��s	z*MinidomTest.testCloneDocumentTypeDeepNotOkcCs�t�}|jd�}|j|dk	o�|j|jko�|j|jko�|j|jko�|j|jko�t|j�dko�|jj	d�dko�t|j
�dko�|j
j	d�dko�t|j�dk�dS)Nr)rr�rrVr�r�r�r?rrrr<)rr
r�rrr�testCloneDocumentTypeShallowOks	z*MinidomTest.testCloneDocumentTypeShallowOkcCs5t�}|jjd�}|j|dkd�dS)Nr�!testCloneDocumentTypeShallowNotOk)rr
r�r)rrr�rrrr�s	z-MinidomTest.testCloneDocumentTypeShallowNotOkcCs;td�}td�}|jtjj|j||�dS)Nz<doc/>)rr]rr�NotSupportedErr�
importNode)rr��testNameZdoc1r�rrr�check_import_documentsz!MinidomTest.check_import_documentcCs|jdd�dS)Nr�testImportDocumentShallow)r�)rrrrr�sz%MinidomTest.testImportDocumentShallowcCs|jdd�dS)Nr8�testImportDocumentDeep)r�)rrrrr�sz"MinidomTest.testImportDocumentDeepcCs8t�}t�}|jtjj|j|jd�dS)Nr)rr
r]rrr�r�r
)r�srcr�rrr�testImportDocumentTypeShallow!s		z)MinidomTest.testImportDocumentTypeShallowcCs8t�}t�}|jtjj|j|jd�dS)Nr8)rr
r]rrr�r�r
)rr�r�rrr�testImportDocumentTypeDeep's		z&MinidomTest.testImportDocumentTypeDeepcCs�td�}|jjd�}|j|d�|j|�}|j|j|��|j|j|��|j|jdk|d�|j|jj|j�|d�|j|j	|d�dS)Nz<doc attr='value'/>r�z: ownerElement should be Nonez: ownerDocument does not matchz.: cloned attribute must have specified == True)
rr4rpZassertNotEqualr�rr�rarZ	specified)rr�r�rr�r�rrr�check_clone_attribute/sz!MinidomTest.check_clone_attributecCs|jdd�dS)Nr�testCloneAttributeShallow)r)rrrrr=sz%MinidomTest.testCloneAttributeShallowcCs|jdd�dS)Nr8�testCloneAttributeDeep)r)rrrrr@sz"MinidomTest.testCloneAttributeDeepcCsitd�}|j}|j|jtj�|j|�}|j|j|jkoa|j	|j	k�dS)Nz<?target data?><doc/>)
rrAr�r�rr�r�rr�rW)rr�r�rr�r�rrr�check_clone_piCs	zMinidomTest.check_clone_picCs|jdd�dS)Nr�testClonePIShallow)r)rrrrrKszMinidomTest.testClonePIShallowcCs|jdd�dS)Nr8�testClonePIDeep)r)rrrrrNszMinidomTest.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)Nz<doc/>�first�secondr7ztestNormalize -- preparationr8�firstsecondztestNormalize -- resultr�rz*testNormalize -- single empty node removed)
rr4rKrJrr?r<r@�	normalizerArBrWr-)rrrFrrr�
testNormalizeQs,	

	
zMinidomTest.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)
Nz<doc/>rr	r�r9z1testNormalizeCombineAndNextSibling -- preparationr7r
z-testNormalizeCombinedAndNextSibling -- result)rr4rKrJr=rr?r<r@rrArWrBrErDr-)rrrFrrr�"testNormalizeCombineAndNextSiblingjs&	
z.MinidomTest.testNormalizeCombineAndNextSiblingcCstd�}|j}|j|jd��|j|jd��|jt|j�dkok|jjdkd�|j�|jt|j�dko�|jjdko�|j	j
dko�|j	|jko�|j	jdko�|j	j
dkd�|j�dS)Nz<doc/>rr�r7z1testNormalizeDeleteWithPrevSibling -- preparationr8z,testNormalizeDeleteWithPrevSibling -- result)rr4rKrJrr?r<r@rrArWrBrErDr-)rrrFrrr�"testNormalizeDeleteWithPrevSiblings 	
z.MinidomTest.testNormalizeDeleteWithPrevSiblingcCstd�}|j}|j|jd��|j|jd��|jt|j�dkok|jjdkd�|j�|jt|j�dko�|jjdko�|j	j
dko�|j	|jko�|j	jdko�|j	j
dkd�|j�dS)Nz<doc/>r�r	r7z1testNormalizeDeleteWithNextSibling -- preparationr8z,testNormalizeDeleteWithNextSibling -- result)rr4rKrJrr?r<r@rrArWrBrErDr-)rrrFrrr�"testNormalizeDeleteWithNextSibling�s 	
z.MinidomTest.testNormalizeDeleteWithNextSiblingcCs1td�}|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)Nz<doc/>r�r�r9z1testNormalizeDeleteWithTwoSiblings -- preparationr7z,testNormalizeDeleteWithTwoSiblings -- result)rr4rKr=rJrr?r<r@rrArBrErDr-)rrrFrrr�)testNormalizeDeleteWithTwoNonTextSiblings�s$	
z5MinidomTest.testNormalizeDeleteWithTwoNonTextSiblingscCsEtd�}|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	j
dkd	�|j�dS)
Nz<doc/>r�r	Zfourth�z,testNormalizeDeleteAndCombine -- preparationr8Zsecondfourthz'testNormalizeDeleteAndCombine -- result)rr4rKrJrr?r<r@rrArBrWrDrEr-)rrrFrrr�testNormalizeDeleteAndCombine�s&	
z)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�|jdjdjdko�|jdjdj
|jdjdko�|jdjdj
dko�|jdjdj|jdjdko�|jdjdjdko�|jdjdj
|jdjdkd�|j�dS)Nz)<doc><o><i/>t</o><o><o>t2</o>t3</o></doc>rr��xr8Zx2Zx3r9r;r7ztestNormalize2 -- preparationz$testNormalize2 -- childNodes lengthsZtxZt2x2Zt3x3z$testNormalize2 -- joined text fieldsz"testNormalize2 -- sibling pointers)
rr4r<rKrJrr?r@rrWrErDr-)rrrFrrr�testNormalizeRecursion�sX	$#
##$#z"MinidomTest.testNormalizeRecursioncCsJtd�}|jjd}|j|jtj�|j�|j�dS)Nz<o>text</o>r)	rr4r<r�r�r�	TEXT_NODErr-)rrr\rrr�testBug0777884s

zMinidomTest.testBug0777884cCsStd�}|j}d|jd_|j�|j|jdjdkd�dS)Nz<o><i/>t</o>r�r8z)Final child's .nextSibling should be NonerT)rr4r<rcrrrE)rrr rrr�testBug1433694s	
zMinidomTest.testBug1433694cCs�td�}|j}|j\}}}|j|j|ko�|jdko�|j|ko�|j|ko�|jdko�|j|kd�|j�dS)Nz<doc><?pi?>text?<elm/></doc>�testSiblings)rr4r<rrErDr-)rrrFr�r\Zelmrrrrs	zMinidomTest.testSiblingscCs�td�}|j}|jd}|j\}}|jd}|j|j|ko�|j|ko�|j|ko�|j|ko�|j|kd�|j�dS)Nz3<doc><elm1><elm2/><elm2><elm3/></elm2></elm1></doc>r�testParents)rr4r<rr�r-)rrrFZelm1Zelm2aZelm2bZelm3rrrr)s		

zMinidomTest.testParentscCs�td�}|j}|d}|j|d|jd�ko�|jd�dko�|jjd�|jdko�|jjd�|jdko�|jjd�jjd�dkd�|j�dS)Nz<doc><e/><e/></doc>rr8ztest NodeList.item())rr<rrr-)rrZchildrenZdocelemrrr�testNodeListItem8s	
!zMinidomTest.testNodeListItemcCs�td�}|j|j�d�|j|jd�d�|j|jd�d�|j|jd�d�|j|jd	�d
jd	��|jttd�|j�dS)Nz<foo>&#x20ac;</foo>u$<?xml version="1.0" ?><foo>€</foo>zutf-8s4<?xml version="1.0" encoding="utf-8"?><foo>€</foo>ziso-8859-15s8<?xml version="1.0" encoding="iso-8859-15"?><foo>�</foo>zus-asciis;<?xml version="1.0" encoding="us-ascii"?><foo>&#8364;</foo>zutf-16u5<?xml version="1.0" encoding="utf-16"?><foo>€</foo>s0<fran�ais>Comment �a va ? Tr�s bien ?</fran�ais>)rr�rC�encoder]�UnicodeDecodeErrorr-)rrrrr�
testEncodingsDs
zMinidomTest.testEncodingsc@s"eZdZdZdd�ZdS)zMinidomTest.UserDataHandlerrcCs7|j||d|�|j|dd�d|_dS)Nr8)�setUserData�called)rZ	operation�keyrWr��dstrrr�handle[sz"MinidomTest.UserDataHandler.handleN)�__name__�
__module__�__qualname__rr"rrrr�UserDataHandlerYsr&cCs�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)Nr�rI�r:�
r8)	rr=rZgetUserDatarr&r�rr-)rr�n�handler�crrr�testUserData`s*	

zMinidomTest.testUserDatacCsZ|jtjj|j|dd�td�}|jtjj|j|tjjd�dS)Nzhttp://xml.python.org/nsz	xmlns:fooz<doc/>rI)r]rr�NamespaceErr�
renameNoderZWrongDocumentErrr�)rrr r�rrr� checkRenameNodeSharedConstraintsxs

z,MinidomTest.checkRenameNodeSharedConstraintscCs�td�}|j}|j}|jd}|j|tjjd�}|j|jdko
|j	dko
|j
dko
|jtjjko
|jdko
|j
dko
|jd�dko
|jd�j|�o
|dj|�o
|jj|�o
|jj|��|j|dd�}|j|jdko|j	dko|j
dko|jdko|jdko|j
dko|jd�dko|jd�dko|jd�j|�o|jdd�j|�o|dj|�o|d
j|��|j|dd�}|j|jdko,|j	dko,|j
d	ko,|jdko,|jd
ko,|j
dko,|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|jtjjkoE|jdkoE|j
dkoE|jd�dkoE|jd�dkoE|jd�dkoE|jd�dkoE|jdd�dkoE|jd�j|�oE|dj|��|jtjj|j|dd�|j||�|j�dS)Nz<doc a='v'/>rer��v�http://xml.python.org/nsr+�http://xml.python.org/ns2zp:dr��pr�Zxmlns)r1r+)r2r�)rr4r_r.rrr�rr�rVr�r�r�rbrpr�rrar�r]r-r/r-)rrrGZattrmapr�rrr�testRenameAttribute�s�		

zMinidomTest.testRenameAttributecCs/td�}|j}|j|tjjd�}|j|jdko�|jdko�|j	dko�|j
tjjko�|jdko�|jj
|��|j|dd�}|j|jdko|jdko|j	dko|j
dko|jdko|jj
|��|j|dd�}|j|jdko�|jdko�|j	dko�|j
dko�|jdko�|jj
|��|j|tjjd	�}|j|jd	ko
|jd	ko
|j	dko
|j
tjjko
|jdko
|jj
|��|j||�|j�dS)
Nz<doc/>rezhttp://xml.python.org/nsr�zhttp://xml.python.org/ns2zp:cr+r3r�)rr4r.rrr�rr�rVr�r�r�rr�r/r-)rrrGrrr�testRenameElement�s@	zMinidomTest.testRenameElementcCsltjjj�jtjjdd�}|jd�}|jtjj|j	|tjjd�|j
�dS)Nr��commentrI)rrrrr	r�rUr]r�r.r-)rrr rrr�testRenameOther�szMinidomTest.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)Nz<doc>a</doc>rrer��abr+�cabr6r�r�y�zZcabd)rr4r<r�r�rrr#rKrJr>�createCDATASectionrUr=rZ�createProcessingInstruction�removeChild)rrrGr\�splitter�text2rrrr�
testWholeTexts8	



zMinidomTest.testWholeTextcCsdtd�}|j}|j}|j|j|kd�|j||�|j|j|kd�dS)Nz<doc><e/></doc>zBefore replaceChild()zAfter replaceChild())rr4rArr�rZ)rrrGr�rrr�testPatch1094164&s		zMinidomTest.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)Nz<doc>a<e/>d</doc>r�r+)rr4rArBrEr>rJr<)rrG�text1r@r?rrr�setup0s				z/MinidomTest.testReplaceWholeText.<locals>.setupznew contentr�r9r9rr�r7)ZreplaceWholeTextr#rr?r<)rrDrrGrCr?r@r\rrr�testReplaceWholeText/s 
z MinidomTest.testReplaceWholeTextcCs�td�}|j}|j}|j|jdkoE|jtjjk�dj	�}xQ|D]I}|j
|�}|j}|jt|d�o�|jtjjk�q\WdS)Nal<!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' />z+id notid text enum ref refs ent ents nm nmsr�)rr4Z
schemaTyperr��	namespacerrr��splitrp�hasattr)rrrGr"�namesr�rerrr�testSchemaTypeLs			
	zMinidomTest.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�|jd�}d|_	|j
|�|j|jd�dkoj|j|jd��oj|joj|joj|j�|j|tj
jd�|j|j|jd��o�|j�dS)Nz<doc a1='v' a2='w'/>r�r�r0�w�an)rr4rpr�getElementByIdr�r�r�ZcreateAttributerb�setAttributeNoder.rrr�)rrr�r�r��a3rrr�testSetIdAttributems6	

	
	
	

	zMinidomTest.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j
jd
�|j|j|jd	��o�|j�dS)Nzhttp://xml.python.org/ns1zhttp://xml.python.org/ns2z<doc xmlns:ns1='z
' xmlns:ns2='z' ns1:a1='v' ns2:a2='w'/>r�r�r0rKrL)rr4r�rrMr�ZsetIdAttributeNSr��createAttributeNSrbrNr.rrr�)r�NS1�NS2rr�r�r�rOrrr�testSetIdAttributeNS�s<	
		
	
z 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j
jd
�|j|j|jd	��o�|j�dS)Nzhttp://xml.python.org/ns1zhttp://xml.python.org/ns2z<doc xmlns:ns1='z
' xmlns:ns2='z' ns1:a1='v' ns2:a2='w'/>r�r�r0rKrL)rr4r�rrMr�ZsetIdAttributeNoder�rQrbrNr.rrr�)rrRrSrr�r�r�rOrrr�testSetIdAttributeNode�s<	

	
	
	
z"MinidomTest.testSetIdAttributeNodecCs�||fg}x�|r�|j�\}}|j|j|j�|jt|j�t|j��|j|j|j�|j|j|��|j|j|��|jtj	kr`t|j
�t|j
�t|j�t|j�|jt|j
�t|j
��|jt|j�t|j��x�tt|j��D]}|jj
|�}|jj
|�}|j|j|j�|j|j|j�|j|j|j�|j||f�qDWx�tt|j
��D]}|j
j
|�}	|j
j
|�}
|j|	j|
j�|j|	j|
j�|j|	j|
j�|j|	|
f�q�W|jtjkr�|j|jj|��|j|jj|��x>tt|j��D]'}|j|j||j|f�q�WqWdS)N)�popr�r�r?r<rVr%r�rr�rrr�rr�r�r�rr�Z
DOCUMENT_NODErr)rrr��stackZn1Zn2r�Zno1Zno2r�r�rrr�assert_recursive_equal�sD	"



""z"MinidomTest.assert_recursive_equalcCsbtt�}xOtdtjd�D]7}tj||�}tj|�}|j||�q#WdS)Nr7r8)r�sampler��pickle�HIGHEST_PROTOCOL�dumps�loadsrX)rr�protor!r�rrr�testPickledDocument�s
zMinidomTest.testPickledDocumentcCs/tt�}tj|�}|j||�dS)N)rrY�copy�deepcopyrX)rrr�rrr�testDeepcopiedDocumentsz"MinidomTest.testDeepcopiedDocumentcCs6t�}|j|jd��|jt|j�dS)Nzfoo--bar)r
rKrUr]�
ValueErrorrC)rrrrr�(testSerializeCommentNodeWithDoubleHyphens	z4MinidomTest.testSerializeCommentNodeWithDoubleHyphencCs>td�}t|j��}|j|jtjjk�dS)Nz$<element xmlns=''>
<foo/>
</element>)rrCrr�rrr�)rrr�rrr�testEmptyXMLNSValueszMinidomTest.testEmptyXMLNSValuec	Cs(|jtd��td�WdQRXdS)NzUnsupported syntaxzE<element xmlns:abc="http:abc.com/de f g/hi/j k"><abc:foo /></element>)ZassertRaisesRegexrcr)rrrr�!testExceptionOnSpacesInXMLNSValuesz-MinidomTest.testExceptionOnSpacesInXMLNSValuecCs�tt�}|jjd�d}|jtjj|j|�t	|j
�}|j|j
d�t	|j
�}|j||dk�dS)NZTITLErr8)rr,r4r3r]rrrzr>r?r<r)rrZ	title_tagZnum_children_beforeZnum_children_afterrrr�testDocRemoveChildszMinidomTest.testDocRemoveChildcCs+tt�}|jdd�}d|_dS)Nr:r;Zcrash)rr,r=rc)rrr�rrr�"testProcessingInstructionNameErrorsz.MinidomTest.testProcessingInstructionNameErrorN)�r#r$r%rr#r)r0r2r5rHrQrSrXrYr[r`rfrgrhrirkrnrsrxryr{r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr
rrrrrrrrrrrr&r,r/r4r5r7rArBrErJrPrTrUrXr_rbrdrerfrgrhrrrrr4s+
		&
		
		"?M+
$	!$$%	r�__main__)r`rZZtest.supportrZunittestZxml.dom.minidomrrrrrrr,rYr
rrZTestCaserr#�mainrrrr�<module>s&"������