+
    Dfj                    v   R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHt  ! R R]P                  4      t ! R	 R
]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      t ! R R]
4      tR# ) z;
Some fairly inadequate testcases for Twisted XML support.
)annotations)reload)BytesIO)Literal)TestCase)
domhelpersmicrodomsuxc                  F    ] tR t^tR R ltR R ltR R ltR R ltR	tR
# )Sux0rc                   V ^8  d   QhRR/#    returnNone )formats   ";/usr/lib/python3/dist-packages/twisted/web/test/test_xml.py__annotate__Sux0r.__annotate__   s      $     c                	    . V n         R # )Ntokensselfs   &r   __init__Sux0r.__init__   s      	r   c                   V ^8  d   QhRR/# )r   r   z2list[tuple[Literal['start'], str, dict[str, str]]]r   )r   s   "r   r   r      s     G GP Gr   c                	b    V P                    Uu. uF  q^ ,          R8X  g   K  VNK  	  up# u upi )    startr   )r   tokens   & r   getTagStartsSux0r.getTagStarts   s)    #';;F;%(g2E;FFFs   ,,c               $    V ^8  d   QhRRRRRR/# )r   namestrattrszdict[str, str]r   r   r   )r   s   "r   r   r      s!     3 3 3N 3t 3r   c                	@    V P                   P                  R W34       R# )r!   Nr   append)r   r&   r(   s   &&&r   gotTagStartSux0r.gotTagStart   s    GT12r   c                    V ^8  d   QhRRRR/# )r   textr'   r   r   r   )r   s   "r   r   r      s     + +C +D +r   c                	@    V P                   P                  R V34       R# )r/   Nr*   )r   r/   s   &&r   gotTextSux0r.gotText   s    FD>*r   r   N)	__name__
__module____qualname____firstlineno__r   r#   r,   r1   __static_attributes__r   r   r   r   r      s    
G3+ +r   r   c                  "    ] tR t^#tR R ltRtR# )SUXTestsc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   SUXTests.__annotate__$   s     4 44 4r   c                	    R p\        4       pVP                  4        VP                  V4       V P                  \	        VP                  4       4      ^4       R# )s   <bork><bork><bork>N)r   connectionMadedataReceivedassertEquallenr#   )r   smss   &  r   	test_borkSUXTests.test_bork$   sB    !W

R__./3r   r   N)r3   r4   r5   r6   rC   r7   r   r   r   r9   r9   #   s    4 4r   r9   c                  v   ] tR t^,tR R ltR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R  ltR! R" ltR# R$ ltR% R& ltR' R( ltR) R* ltR+ R, ltR- R. ltR/ R0 ltR1 R2 ltR3 R4 ltR5 R6 ltR7 R8 lt. RgOt R9 R: lt!R; R< lt"R= R> lt#R? R@ lt$RA RB lt%RC RD lt&RE RF lt'RG RH lt(RI RJ lt)RK RL lt*RM RN lt+RO RP lt,RQ RR lt-RS RT lt.RU RV lt/RW RX lt0RY RZ lt1R[ R\ lt2R] R^ lt3R_ R` lt4Ra Rb lt5Rc Rd lt6Ret7Rf# )hMicroDOMTestsc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   MicroDOMTests.__annotate__-   s     
 
$ 
r   c           	     4   Rp\         P                  ! VRR7      pV P                  VP                  4       P	                  4       R4       \        4       pVP                  4       P                  VRRRR/ R4       V P                  VP                  4       R4       R# )zr
Make sure that if there's no top-level node lenient-mode won't
drop leading text that's outside of any elements.
zHi orders! <br>Well. <br>TbeExtremelyLenientz*<html>Hi orders! <br />Well. <br /></html> s*   <html>Hi orders! <br />Well. <br /></html>Nr   parseStringr?   
firstChildtoxmlr   writexmlgetvaluer   rA   d
byteStreams   &   r   test_leadingTextDropping&MicroDOMTests.test_leadingTextDropping-   s    
 (  t<LLN  "$P	
 Y
	
BBBC!#P	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   =   s     
R 
R4 
Rr   c           	     4   Rp\         P                  ! VRR7      pV P                  VP                  4       P	                  4       R4       \        4       pVP                  4       P                  VRRRR/ R4       V P                  VP                  4       R4       R# )zf
Ensure that no *trailing* text in a mal-formed
no-top-level-element document(s) will not be dropped.
z<br>Hi orders!TrJ   z<html><br />Hi orders!</html>rL   s   <html><br />Hi orders!</html>NrM   rS   s   &   r   test_trailingTextDropping'MicroDOMTests.test_trailingTextDropping=   s|    
   t<--/1PQY
	
BBBC,,.0PQr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   I   s     L LT Lr   c                    Rp\         P                  ! VRR7      pV P                  VP                  4       P	                  4       R4       R# )zX
A string with nothing that looks like a tag at all should just
be parsed as body text.
z
Hi orders!TrJ   z<html>Hi orders!</html>Nr   rN   r?   rO   rP   r   rA   rT   s   &  r   test_noTagsMicroDOMTests.test_noTagsI   s;    
   t<--/1JKr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   R   s     R Rd Rr   c                    Rp\         P                  ! VRR7      pV P                  VP                  4       P	                  4       R4       R# )zT
If a document is surrounded by non-xml text, the text should
be remain in the XML.
zHi<br> orders!TrJ   z<html>Hi<br /> orders!</html>Nr^   r_   s   &  r   test_surroundingCrap"MicroDOMTests.test_surroundingCrapR   s;    
   t<--/1PQr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   [   s     / /d /r   c                	   R p\         P                  ! V^R7      p\        P                  ! VP                  R4      p\        P
                  ! V^ ,          ^4      P                  RR4      pV P                  VP                  R4      R4       R# )al  
              <HTML><BODY>
              <P ALIGN="CENTER">
                <A HREF="http://www.apache.org/"><IMG SRC="/icons/apache_pb.gif"></A>
              </P>

              <P>
                This is an insane set of text nodes that should NOT be gathered under
                the A tag above.
              </P>
              </BODY></HTML>
            rJ   az&nbsp; insaneN)	r   rN   r   findNodesNameddocumentElementgatherTextNodesreplacer?   find)r   rA   rT   lns   &    r   test_caseSensitiveSoonCloser*MicroDOMTests.test_caseSensitiveSoonCloser[   sq       q9%%a&7&7=&&qtQ/77#F)2.r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   m   s     

 

t 

r   c                    Rp\         P                  ! V^R7      pV P                  VP                  VP                  P	                  4       P
                  4       R# )zr
Test that C{parentNode} attributes are set to meaningful values when
we are parsing HTML that lacks a root node.
z
<br/><br/>rJ   Nr   rN   assertIdenticalrm   rO   
parentNoder_   s   &  r   test_lenientParenting#MicroDOMTests.test_lenientParentingm   sI       q9q00;;=HH	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   y   s     	
 	
$ 	
r   c                    Rp\         P                  ! V^R7      pV P                  VP                  VP                  P	                  4       P
                  4       R# )z
Test that the C{parentNode} attribute is set to a meaningful value
when we parse an HTML document that has a non-Element root node.
HellorJ   Nrw   r_   s   &  r   test_lenientParentSingle&MicroDOMTests.test_lenientParentSingley   sI    
   q9q00;;=HH	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     - - -r   c                	    R p\         P                  ! V^R7      p\        P                  ! V4      pV P	                  VP                  R4      R4       R# )z
                <HTML>
                    This HTML goes between Stupid <=CrAzY!=> Dumb.
                </HTML>
            rJ   >Nrk   )r   rN   r   rn   assertNotEqualrp   r   rA   rT   rr   s   &   r   test_unEntitiesMicroDOMTests.test_unEntities   sE    
   q9&&q)AFF3K,r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     D D Dr   c                	d    V P                  \        P                  \        P                  R 4       R# )rL   N)assertRaisesr	   
ParseErrorr   rN   r   s   &r   test_emptyErrorMicroDOMTests.test_emptyError   s    #..(*>*>Cr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     X X4 Xr   c                	    R p\         P                  ! V4      pV P                  \        P                  ! VP
                  4      P                  4       R4       R# )z
        <test>
         <it>
          <is>
           <a>
            test
           </a>
          </is>
         </it>
        </test>
        testN)r   rN   r?   r   rn   rm   stripr_   s   &  r   test_tameDocumentMicroDOMTests.test_tameDocument   sF    
   #33A4E4EFLLNPVWr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     $ $4 $r   c                	    R p\         P                  ! V^R7      p\        P                  ! VP                  R4      pV P                  \        V4      ^4       R# )a  
        <html>
        <head><title> I send you this message to have your advice!!!!</titl e
        </headd>

        <body bgcolor alink hlink vlink>

        <h1><BLINK>SALE</blINK> TWENTY MILLION EMAILS & FUR COAT NOW
        FREE WITH `ENLARGER'</h1>

        YES THIS WONDERFUL AWFER IS NOW HERER!!!

        <script LANGUAGE="javascript">
function give_answers() {
if (score < 70) {
alert("I hate you");
}}
        </script><a href=/foo.com/lalal name=foo>lalal</a>
        </body>
        </HTML>
        rJ   blinkN)r   rN   r   rl   rm   r?   r@   )r   rA   rT   rq   s   &   r   test_awfulTagSoupMicroDOMTests.test_awfulTagSoup   sI    *   q9%%a&7&7AQ#r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     
 
T 
r   c                	b   R p\         P                  ! V^R7      pV P                  VP                  4       P                  4       P                  4       P                  R4       V P                  VP                  4       P                  R4      ^,          P                  4       P                  R4       R# )z
        <script>(foo < bar) and (bar > foo)</script>
        <script language="javascript">foo </scrip bar </script>
        <script src="foo">
        <script src="foo">baz</script>
        <script /><script></script>
        rJ   z(foo < bar) and (bar > foo)scriptzfoo </scrip bar N)r   rN   r?   rO   datagetElementsByTagNamer_   s   &  r   test_scriptLeniency!MicroDOMTests.test_scriptLeniency   s       q9LLN%%'22499;X	
 	LLN//9!<GGINN	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     
 
 
r   c                	   R pV P                  \        P                  ! V^R7      P                  4       P	                  4       V4       RpV P                  \        P                  ! V^R7      P                  4       P	                  4       V4       RpV P                  \        P                  ! V^R7      P                  4       P	                  4       V4       R# )z<script><!-- lalal --></script>rJ   z"<script><![CDATA[lalal]]></script>z:<script> // <![CDATA[
        lalal
        //]]></script>N)r?   r   rN   rO   rP   r   rA   s   & r   test_scriptLeniencyIntelligence-MicroDOMTests.test_scriptLeniencyIntelligence   s     2  q9DDFLLNPQ	
 5  q9DDFLLNPQ	
 	  q9DDFLLNPQ	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     W W4 Wr   c                	   R pVP                  4       P                  RR4      p\        P                  ! V^^R7      p\        P                  ! V^^ R7      p\        P                  ! V^ ^R7      p\        P                  ! V^^ R7      p\        P                  ! V^^R7      pV P	                  VP
                  P                  4       V4       V P                  VP                  V4      VP                  4       : RVP                  4       : 24       V P                  VP                  V4      VP                  4       : RVP                  4       : 24       V P                  VP                  V4      VP                  4       : RVP                  4       : 24       V P                  VP                  V4      VP                  4       : RVP                  4       : 24       R# )zH<eNcApSuLaTe><sUxor></sUxor><bOrk><w00T>TeXt</W00t></BoRk></EnCaPsUlAtE>r/   TeXtcaseInsensitivepreserveCasez != N)	lowerro   r   rN   r?   rm   rP   
assertTrueisEqualToDocument)r   rA   s2rT   d2d3d4d5s   &       r   test_preserveCaseMicroDOMTests.test_preserveCase   sh   VWWYvv.  AAF!!!QQG !!"aaH!!"aaH!!"aaH
 	**002A6++B/AGGI=RXXZN1ST,,R0RXXZN$rxxzn2UV 	,,R0RXXZN$rxxzn2UV,,R0RXXZN$rxxzn2UVr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     3 3d 3r   c                	    R p\         P                  ! V4      pVP                  pV P                  VP	                  R4      R4       V P                  VP	                  R4      R4       R# )z<test a="a" b='b' />rh   bNr   rN   rm   r?   getAttributer   rA   rT   es   &   r   test_differentQuotes"MicroDOMTests.test_differentQuotes   sT    $  #,c2,c2r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH      s     4 4 4r   c                	    R p\         P                  ! V4      pVP                  pV P                  VP	                  R4      R4       V P                  VP	                  R4      R4       R# )z<test 
a="a"
	b="#b" />rh   r   z#bNr   r   s   &   r   test_LinebreaksMicroDOMTests.test_Linebreaks   sT    (  #,c2,d3r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     P PT Pr   c                	v    R F2  pV P                  \        P                  \        P                  V4       K4  	  R# )<test>N)r   z<test> </tset>z</test>)r   r   MismatchedTagsrN   r   s   & r   test_mismatchedTags!MicroDOMTests.test_mismatchedTags  s*    6Ah55x7K7KQO 7r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     
7 
7d 
7r   c                	   R p\         P                  ! V4      pVP                  pV P                  VP                  R4       VP
                  ^ ,          pV P                  \        V\         P                  4      4       V P                  VP                  R4       VP                  4       pV P                  WEJ4       V P                  VP                  4       R4       R# )z<bar><!--<foo />--></bar>bar<foo />z<!--<foo />-->N)r   rN   rm   r?   nodeName
childNodesr   
isinstanceCommentvalue	cloneNoderP   )r   rA   rT   r   cc2s   &     r   test_commentMicroDOMTests.test_comment  s    '  #U+LLO
1h&6&678),[[]$%56r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     0 04 0r   c                	z   \         P                  ! R 4      P                  pVP                  ^ ,          pV P	                  \        V\         P                  4      4       V P                  VP                  R4       VP                  4       pV P	                  W2J4       V P                  VP                  4       R4       R# )z<bar>xxxx</bar>xxxxN)r   rN   rm   r   r   r   Textr?   r   r   rP   )r   rT   r/   clones   &   r   	test_textMicroDOMTests.test_text  s      !23CC||A
478V, )*/r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     E Et Er   c                	   \         P                  ! R 4      P                  P                  pV P	                  \        V4      ^4       V P	                  V^ ,          P                  R4       V P	                  V^,          P                  R4       V P	                  V^ ,          P                  4       P                  4       R4       V F,  pV P                  \        V\         P                  4      4       K.  	  R# )z<b>&amp;&#12AB;</b>&amp;z&#12AB;N)r   rN   rm   r   r?   r@   r   r   rP   r   r   EntityReference)r   nodesrr   s   &  r   test_entitiesMicroDOMTests.test_entities  s    $$%:;KKVVUQ'q0q	2q++-335w?AOOJq(*B*BCD r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   %  s     R RD Rr   c                	R   R p\         P                  ! V4      P                  P                  ^ ,          pV P	                  \        V\         P                  4      4       V P                  VP                  R4       V P                  VP                  4       P                  4       R4       R# )z<x><![CDATA[</x>
 & foo]]></x>z</x>
 & fooz<![CDATA[</x>
 & foo]]>N)r   rN   rm   r   r   r   CDATASectionr?   r   r   rP   )r   rA   cdatas   &  r   
test_CDataMicroDOMTests.test_CData%  sw    /$$Q'77BB1E
5(*?*?@A%56*0024PQr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   ,  s     	1 	1 	1r   c                	   R pRp\         P                  ! V4      P                  P                  p\         P                  ! V4      P                  P                  pV P	                  \        V4      ^4       \        W44       Fj  w  rVV P                  \        V\         P                  4      4       V P	                  VP                  R4       V P                  VP                  V4      4       Kl  	  R# )z<foo><b/><b /><b
/></foo>z<foo><b/><b/><b/></foo>r   N)r   rN   rm   r   r?   r@   zipr   r   Elementr   isEqualToNode)r   rA   r   r   nodes2rr   n2s   &      r   test_singletonsMicroDOMTests.test_singletons,  s    (&$$Q'77BB%%b)99DDUQ''EAOOJq(*:*:;<QZZ-OOAOOB/0 (r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   7  s     : : :r   c                	   R p\         P                  ! V4      P                  pV P                  VP	                  R4      R4       V P                  VP	                  R4      R4       V P                  VP                  R4      4       V P                  VP                  R4      '       * 4       VP                  R4      pV P                  VP                  R4       VP                  RR4       V P                  VP	                  R4      R4       R# )z<foo a="b" />rh   r   r   Nfoor   )
r   rN   rm   r?   r   r   hasAttributegetAttributeNoder   setAttribute)r   rA   noderh   s   &   r   test_attributesMicroDOMTests.test_attributes7  s    ##A&66**3/5**3/6))#./D--c223!!#&#&%'**5159r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   E  s     < <t <r   c                	   R p\         P                  ! V4      P                  pT P                  VP                   Uu. uF  q3P
                  NK  	  up. RO4       V P                  VP                  4       P
                  R4       V P                  VP                  4       P
                  R4       V P                  VP                  4       4       V P                  VP                  4       P                  4       '       * 4       R# u upi )z'<foo><bar /><baz /><bax>foo</bax></foo>r   baxN)r   bazr   )
r   rN   rm   r?   r   r   	lastChildrO   r   hasChildNodesr   s   &   r   test_childrenMicroDOMTests.test_childrenE  s    5  #33all;l**l;=RS//700%8)*ALLN88::;	 <s   Dc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   N  s     - -T -r   c                	   R pRpRp\         P                  ! V4      P                  p\         P                  ! V4      P                  p\         P                  ! V4      P                  pVP                  VP	                  4       4       VP                  RR4       VP                  ^ ,          pV P                  VP                  R4      R4       V P                  VP                  R4       VP                  \         P                  ! R4      V4       V P                  VP                  ^ ,          P                  R4       V P                  VP                  ^,          V4       VP                   F  pV P                  VP                  V4       K!  	  V P                  VP                  V4      4       VP                  V4       V P                  \!        VP                  4      ^4       V P                  VP                  ^ ,          P                  R4       \         P"                  ! R4      p	VP%                  WP'                  4       4       V P                  VP'                  4       V	4       V P                  VP                  V4      4       R# )r   z<foo a="b"><bar/><foo/></foo>z<foo a="b">foo</foo>rh   r   Nr   r   )r   rN   rm   appendChildr   r   r   r?   r   r   insertBeforer   ry   r   r   removeChildr@   r   replaceChildrO   )
r   rA   s1r   rT   d1r   childrr   ts
   &         r   test_mutateMicroDOMTests.test_mutateN  s   ,#  #33!!"%55!!"%55	akkm$	sC Q++C0$7/	x''.6a1159a%0AQ\\1- +,	eQ\\*A.a1159MM% 	q,,.)++,r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   l  s     	P 	Pd 	Pr   c                    \         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      pV P                  \        VP                  W24       R# )z
L{Node.replaceChild} raises L{ValueError} if the node given to be
replaced is not a child of the node C{replaceChild} is called on.
r   z<bar />z<baz />N)r   rN   r   
ValueErrorr	  )r   parentorphanreplacements   &   r   test_replaceNonChild"MicroDOMTests.test_replaceNonChildl  sL    
 %%i0%%i0**95*f&9&9;Or   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   w  s     
 
T 
r   c                	v   R pRp\         P                  ! V4      p\         P                  ! V^ ^R7      p\         P                  ! V^^R7      pVP                  pV P                  VP	                  4       VP                  R4      4       V P                  VP                  R4      WfP                  4       P	                  4       .4       VP                  pV P                  VP	                  4       VP                  R4      4       V P                  VP                  R4      V.4       V P                  VP                  R4      VP                  4       P	                  4       .4       V P                  VP                  R4      . 4       VP                  pV P                  VP	                  4       VP                  R4      4       V P                  VP                  R4      WfP                  4       P	                  4       .4       V P                  VP                  R4      WfP                  4       P	                  4       .4       R# )	z,<foo><bar id='me' /><baz><foo /></baz></foo>z,<fOo><bAr id='me' /><bAz><fOO /></bAz></fOo>r   mer   fOofOOFOON)r   rN   rm   r?   rO   getElementByIdr   r   )r   rA   r   rT   r   r   roots   &      r   test_searchMicroDOMTests.test_searchw  s   :;  #!!"aaH!!"aaH  *A,<,<T,BC""5)D..2B2M2M2O+P	
 !!*B,=,=d,CD007$@##E*T^^-=-H-H-J,K	
 	007<!!*B,=,=d,CD##E*T>>3C3N3N3P,Q	
 	##E*T>>3C3N3N3P,Q	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     M Md Mr   c                	   R pRp\         P                  ! V4      p\         P                  ! V4      pV P                  VP                  R4       V P                  VP	                  4       V4       V P                  VP                  V4      4       V P                  VP                  P                  VP                  4      4       R# )z`<?xml version="1.0"?><!DOCTYPE foo PUBLIC "baz" "http://www.example.com/example.dtd"><foo></foo><foo/>5foo PUBLIC "baz" "http://www.example.com/example.dtd"N)
r   rN   r?   doctyperP   assertFalser   r   rm   r   )r   rA   r   rT   r   s   &    r   test_doctypeMicroDOMTests.test_doctype  s     	

   #!!"%IIN	
 	A&,,R01))778J8JKLr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     5 5T 5r   c                	&   V P                    F  w  r\        P                  ! V^ R7      p\        P                  ! V^ R7      pVP                  P	                  4       pV P                  W%4       V P                  VP                  V4      4       K  	  R# )r    r   N)samplesr   rN   rm   rP   r?   r   r   )r   rA   outrT   r   testOuts   &     r   test_outputMicroDOMTests.test_output  so    llFA$$Q:A%%c1=B''--/GS*OOA//34 #r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     B BT Br   c                	b    R F(  pV P                  \        \        P                  V4       K*  	  R# )<foo>&am</foo>N)r4  z<fooz<f>&</f>z<() />)r   	Exceptionr   rN   r   s   & r   test_errorsMicroDOMTests.test_errors  s%    AAi)=)=qA Br   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     K Kd Kr   c                	   R pRpRpRp\         P                  ! V4      p\         P                  ! V4      p\         P                  ! V^R7      p\         P                  ! V^^R7      p\         P                  ! V^^ R7      p	\         P                  ! V^ ^ R7      p
\         P                  ! V4      P                  P                  4       pV P	                  \         P
                  \         P                  V^ R7       V P                  W4       V P                  VP                  V4      4       V P                  VP                  V4      4       V P                  VP                  P                  R4      4       V P                  V
P                  P                  R4      4       V P                  VP                  P                  4       R4       V P                  V	P                  P                  4       R4       R	# )
z<foo a='b'><BAx>x</bax></FOO><foo a="b"><bax>x</bax></foo>z<FOO a='b'><BAx>x</BAx></FOO><foo A='b'>x</foo>r,  r   rh   <foo A="b">x</foo>z<foo a="b">x</foo>N)r   rN   rm   rP   r   r   r?   r   r   r   r'  )r   rA   r   s3s4rT   r   r   r   r   d6r.  s   &           r   test_caseInsensitive"MicroDOMTests.test_caseInsensitive  s   +,,!  #!!"%!!"a8!!"aaH!!"aaH!!"aaH""1%55;;=##X%9%91a 	 	
 	!++B/0++B/0**77<=++88=>++1135IJ++1135IJr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     V Vt Vr   c                	$   R p\         P                  ! V4      pV P                  VP                  P	                  4       '       * VP                  P
                  4       V P                  VP                  \         P                  ! R4      4      4       R# )z<hello>
        </hello>z<hello></hello>N)r   rN   r   rm   r  r   r   r_   s   &  r   test_eatingWhitespace#MicroDOMTests.test_eatingWhitespace  sm      #!!//1113D3D3O3O	
 	++H,@,@AR,STUr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     P Pt Pr   c                	B   R pR FT  w  r#\         P                  ! V RV R2^R7      pV P                  VP                  P	                  4       RV,          4       KV  	  \         P                  ! R^R7      pV P                  VP                  P	                  4       R4       R# )	z<?xml version='1.0'?>z<pre>z</pre>rJ   z<pre>%s</pre>z<t>hello & there</t>z<t>hello &amp; there</t>N))&r   )z& z&amp; )r   r   )z&hello monkeyz&amp;hello monkeyr   rN   r?   rm   rP   )r   prefixiorT   s   &    r   test_lenientAmpersand#MicroDOMTests.test_lenientAmpersand  s    (
DA $$xuQCv%>STUAQ..446!8KL
   !7AN**0024NOr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     V V Vr   c                	    \         P                  ! R ^R7      pV P                  VP                  P	                  4       P                  4       R4       R# )z3<?xml version='1.0'?><bar><xA><y>c</Xa> <foo></bar>rJ   z<xa><y>c</y></xa>N)r   rN   r?   rm   rO   rP   )r   rT   s   & r   test_insensitiveLenient%MicroDOMTests.test_insensitiveLenient  sC      AVW
 	**557==?ATUr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     + + +r   c                	    R p\         P                  ! V^R7      pRpVP                  P                  4       pV P	                  W44       R# )z<ul><li>foo<li>bar<li>baz</ul>rJ   z-<ul><li>foo</li><li>bar</li><li>baz</li></ul>Nr   rN   rm   rP   r?   r   rA   rT   expectedactuals   &    r   test_laterCloserSimple$MicroDOMTests.test_laterCloserSimple  s@    ,  q9B""((**r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     + + +r   c                	    R p\         P                  ! V^R7      pRpVP                  P                  4       pV P	                  W44       R# )z<DL><p><DT>foo<DD>bar</DL>rJ   z(<dl><p></p><dt>foo</dt><dd>bar</dd></dl>NrU  rV  s   &    r   test_laterCloserCaseInsensitive-MicroDOMTests.test_laterCloserCaseInsensitive  s@    (  q9=""((**r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     + +D +r   c                	    R pRp\         P                  ! V^R7      pVP                  P                  4       pV P	                  W$4       R# )zK<dl><dt>word<dd>definition<dt>word<dt>word<dd>definition<dd>definition</dl>zi<dl><dt>word</dt><dd>definition</dd><dt>word</dt><dt>word</dt><dd>definition</dd><dd>definition</dd></dl>rJ   NrU  )r   rA   rW  rT   rX  s   &    r   test_laterCloserDL MicroDOMTests.test_laterCloserDL  sL     	
 	   q9""((**r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     +
 +
t +
r   c                	  a ^ RI oRpRpRpR V3R llp\        P                  ! V! VP                  R4      4      4      p\        P                  ! VP                  R4      4      p\        P                  ! V4      pV P	                  VP                  V4      4       V P	                  VP                  V4      4       \        P                  ! V4      p\        P                  ! V! V4      4      p\        P                  ! V4      pV P	                  VP                  V4      4       V P	                  VP                  V4      4       \        P                  ! R4      pR	p	\        P                  ! 4       P                  R
^R7      P                  p
VP                  pVP                  V
4       VP                  VP                  R
4      4       V P                  VP                  4       V	R,           4       R# )r    Nz<foo><bar><baz /></bar></foo>ub   <?xml version="1.0" encoding="UCS-2" ?>
<JAPANESE>
<TITLE>専門家リスト </TITLE></JAPANESE>s   < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " U C S - 2 "   ? >  
 < J A P A N E S E >  
 < T I T L E > \[000  < / T I T L E > < / J A P A N E S E > c                    V ^8  d   QhRRRR/# )r   rA   bytesr   r   )r   s   "r   r   9MicroDOMTests.test_unicodeTolerance.<locals>.__annotate__  s     	H 	HE 	He 	Hr   c                   < \        \        V 4      ^,          4      R,           pSP                  ! RV,           .SP                  RV,           V 4      O5!  # )r   H<r   )r'   r@   packunpack)rA   fmtstructs   & r   reverseBytes9MicroDOMTests.test_unicodeTolerance.<locals>.reverseBytes  sA    c!fk"S(C;;sSyG6==sA+FGGr   zUTF-16r$  z<?xml version="1.0"?>u   √rawu#   <foo><div>√</div><!--√--></foo>)rn  r   rN   encoder   r   lmxr/   r   rm   r  createCommentr?   rP   )r   rA   jj2ro  urdudsdj3hdrdivdern  s   &           @r   test_unicodeTolerance#MicroDOMTests.test_unicodeTolerance  s   +N 	

P 		H 	H ""<0B#CD!!!((8"45!!!$,,R01,,S12!!!$""<#34!!"%,,R01,,S12 !!(+%lln!!(!277
s
r''12HHJJJ	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   :  s     ? ?D ?r   c                	L   R ^R^ R^/pVP                  4        F  p\        P                  ! V4      P                  p\        P
                  ! VR4      pV P                  \        V4      W,          4       V'       g   Ke  V P                  \        V^ ,          R4      4       K  	  R# )z:<foo><bar /><bar unf='1' /><bar>asdfadsf</bar><bam/></foo>z<foo>asdf</foo>z!<foo><bar><bar></bar></bar></foo>r   tagNameN)
keysr   rN   rm   r   namedChildrenr?   r@   r   hasattr)r   testsr  r   results   &    r   test_namedChildren MicroDOMTests.test_namedChildren:  s    KQq/

 A''*::D--dE:FS[%(3vq	9 => r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   G  s     : : :r   c                	   R p\         P                  ! V4      P                  pVP                  ^R7      pV P	                  W#4       V P                  \        VP                  4      \        VP                  4      4       VP                  4       VP                  4       rTV P	                  WE4       V P                  \        VP                  4      \        VP                  4      4       V P	                  VP                  4       VP                  4       4       V P                  WP                  4       4       V P                  VP                  VP                  4       R# )r:  deepN)r   rN   rm   r   failIfEqualsr?   r@   r   rO   rP   	namespace)r   rA   r   r   c1r   s   &     r   test_cloneNodeMicroDOMTests.test_cloneNodeG  s    +##A&66A&$&T__-s53C3C/DE"E$4$4$6B"!R]]+S-?@"--/2==?;KKM*9r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   T  s     7 7D 7r   c                	   R p\         P                  ! V4      pVP                  ^R7      pV P                  W#4       V P	                  \        VP                  4      \        VP                  4      4       V P	                  WP                  4       4       V P                  VP                  V4      4       V P                  VP                  V4      4       R# )z<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><foo></foo>r  N)
r   rN   r   r  r?   r@   r   rP   r   r   )r   rA   r   r   s   &   r   test_cloneDocument MicroDOMTests.test_cloneDocumentT  s    T 	
 ##A&A&$&T__-s53C3C/DEKKM*//56..u56r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   d  s     
' 
'$ 
'r   c                	R   \         P                  ! R 4      p\         P                  ! V4      pVP                  R4       VP	                  RR7      pRVP                  4       R&   VP                  4        VP                  RRR7       RpV P                  WAP                  4       4       R	# )
pr   r   )rh   zr   y)r   zF<p>foo<b a="c"><foo z="foo"></foo><foo></foo><bar c="y"></bar></b></p>N)	r   r   rt  r/   r   r   addr?   rP   )r   rr   rt  r   rA   s   &    r   test_LMXMicroDOMTests.test_LMXd  sz    S!ll1oEECEL		esTGGI&r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   p  s      4 r   c                H    \         P                  ! R4      p\        V4       R# )z)
Returns a dictionary which is hashable.
r  N)r   r   hash)r   rr   s   & r   	test_dictMicroDOMTests.test_dictp  s     S!Qr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH   w  s     7 7t 7r   c                	    R pRp\         P                  ! V4      pV P                  W24       V P                  \         P                  ! V4      V4       R# )z&'some "stuff"', <what up?>z/&amp;'some &quot;stuff&quot;', &lt;what up?&gt;N)r   escaper?   unescape)r   rr  cookedesc1s   &   r   test_escapingMicroDOMTests.test_escapingw  sC    -Bs#&**40#6r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     
 
 
r   c                	   R p\         P                  ! V4      pVP                  4       pV P                  VP                  P
                  R4       V P                  VP                  P                  R4      ^ ,          P
                  R4       V P                  VP                  P                  R4      ^,          P                  RR4      R4       \         P                  ! V4      pV P                  VP                  P
                  R4       V P                  VP                  P                  R4      ^ ,          P
                  R4       V P                  VP                  P                  R4      ^,          P                  RR4      R4       R# )z
        <x xmlns="base">
        <y />
        <y q="1" x:q="2" y:q="3" />
        <y:y xml:space="1">here is    some space </y:y>
        <y:y />
        <x:y />
        </x>
        baser  q1N)r   rN   toprettyxmlr?   rm   r  r   getAttributeNS)r   rA   rT   r   r   s   &    r   test_namespacesMicroDOMTests.test_namespaces  sB      #]]_**44f=2237:DDf	
 	2237:II&RUV	

 !!"%++55v>33C8;EEv	
 	33C8;JJ6SVW	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     	! 	!d 	!r   c                t    Rp\         P                  ! V4      P                  4       pV P                  W4       R# )zG
Test that C{toxml} can support xml structures that remove namespaces.
z`<?xml version="1.0"?><html xmlns="http://www.w3.org/TR/REC-html40"><body xmlns=""></body></html>N)r   rN   rP   r?   )r   r
  r   s   &  r   test_namespaceDelete"MicroDOMTests.test_namespaceDelete  s5    
, 	 !!"%++- r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     
 
4 
r   c                    \         P                  ! R4      p\         P                  ! RRR7      pV.Vn        V P                  VP	                  4       R4       R# )z
Check that unspecified namespace is a thing separate from undefined
namespace. This test added after discovering some weirdness in Lore.
olr}  zhttp://www.w3.org/1999/xhtmlr  z9<div xmlns="http://www.w3.org/1999/xhtml"><ol></ol></div>N)r   r   r   r?   rP   )r   r  r  s   &  r   test_namespaceInheritance'MicroDOMTests.test_namespaceInheritance  sK       &!!%3QR"GLLNW	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     )( )(4 )(r   c                |   RpRp\         P                  ! 4       pVP                  RVR7      pVP                  VR/4       VP                  RVR7      pVP                  RVR7      pVP	                  V4       VP	                  V4       VP	                  V4       RpVP                  4       pV P                  W4       R	# )
z
XML elements with a prefixed name as per upper level tag definition
have a start-tag of C{"<prefix:tag>"} and an end-tag of
C{"</prefix:tag>"}.

Refer to U{http://www.w3.org/TR/xml-names/#ns-using} for details.
http://example.com/outerhttp://example.com/innerr  r  innertagr  z<?xml version="1.0"?><root xmlns="http://example.com/outer" xmlns:inner="http://example.com/inner"><inner:tag><inner:child></inner:child></inner:tag></root>N)r   DocumentcreateElementaddPrefixesr  rP   r?   )	r   outerNamespaceinnerNamespacedocumentr  r  r  xmlOkxmlOuts	   &        r   test_prefixedTagsMicroDOMTests.test_prefixedTags  s     43$$& %%f%G 	.'23 $$Un$E &&w.&IT" 	 !'r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     9( 9( 9(r   c                |   RpRp\         P                  ! 4       pVP                  RVR7      pVP                  V4       VP	                  VR/4       VP                  RVR7      pVP                  V4       VP                  RVR7      pVP                  V4       RpVP                  4       pV P                  W4       R	# )
a  
Children of prefixed tags respect the default namespace at the point
where they are rendered.  Specifically, they are not influenced by the
prefix of their parent as that prefix has no bearing on them.

See U{http://www.w3.org/TR/xml-names/#scoping} for details.

To further clarify the matter, the following::

    <root xmlns="http://example.com/ns/test">
        <mytag xmlns="http://example.com/ns/mytags">
            <mysubtag xmlns="http://example.com/ns/mytags">
                <element xmlns="http://example.com/ns/test"></element>
            </mysubtag>
        </mytag>
    </root>

Should become this after all the namespace declarations have been
I{moved up}::

    <root xmlns="http://example.com/ns/test"
          xmlns:mytags="http://example.com/ns/mytags">
        <mytags:mytag>
            <mytags:mysubtag>
                <element></element>
            </mytags:mysubtag>
        </mytags:mytag>
    </root>
r  r  r  r  r  mytagmysubtagz<?xml version="1.0"?><root xmlns="http://example.com/outer" xmlns:inner="http://example.com/inner"><inner:mytag><mysubtag></mysubtag></inner:mytag></root>N)r   r  r  r  r  rP   r?   )	r   r  r  r  r  r  r  r  r  s	   &        r   test_prefixPropagation$MicroDOMTests.test_prefixPropagation  s    < 43$$&%%f%GT" 	.'23&&w.&I ))*)O(# 	 !'r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rH     s     

 

$ 

r   c                    \        \        4       V P                  V P                  .4      pV P	                  ^\        V4      4       V P	                  RV^ ,          R,          4       R# )z/
An import will raise the deprecation warning.
z6twisted.web.microdom was deprecated at Twisted 23.10.0messageN)r   r   flushWarningstest_deprecationr?   r@   )r   warningss   & r   r  MicroDOMTests.test_deprecation  sV     	x%%t'<'<&=>CM*DQK	"	
r   r   N))z<img/>z<img />)r;  r<  )z<foo><BAR /></foo>z<foo><BAR></BAR></foo>)"<foo>hello there &amp; yoyoy</foo>r  )8r3   r4   r5   r6   rV   rZ   r`   rd   rs   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r   r(  r-  r0  r6  r@  rD  rM  rQ  rY  r]  ra  r  r  r  r  r  r  r  r  r  r  r  r  r  r7   r   r   r   rF   rF   ,   s   
 
RLR/$

	
-DX$4
"
$W034P
70ER	1:<-<	P
<M G5BK.VPV+++"+
Z?:7 
'7
@	!
)(V9(v

 

r   rF   c                  f    ] tR tRtRtRR R lltR R ltR R ltR	 R
 ltR R lt	R R lt
RtR# )BrokenHTMLTestsi*  a+  
Tests for when microdom encounters very bad HTML and C{beExtremelyLenient}
is enabled. These tests are inspired by some HTML generated in by a mailer,
which breaks up very long lines by splitting them with '!\n '.
The expected behaviour is loosely modelled on the way Firefox treats very
bad HTML.
c               (    V ^8  d   QhRRRRRRRR/# )r   inputr'   rW  rK   intr   r   r   )r   s   "r   r   BrokenHTMLTests.__annotate__3  s2     C CC$'C=@C	Cr   c                    \         P                  ! WR7      pV P                  VP                  P	                  4       V4       R# )zq
Check that C{input}, when parsed, produces a DOM where the XML
of the document element is equal to C{expected}.
rJ   NrI  )r   r  rW  rK   outputs   &&&& r   checkParsedBrokenHTMLTests.checkParsed3  s3     %%eS//557Br   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  =  s     * *$ *r   c                0    RpRpV P                  W4       R# )z
Check that microdom does its best to handle broken attribute names.
The important thing is that it doesn't raise an exception.
z6<body><h1><div al!
 ign="center">Foo</div></h1></body>z;<body><h1><div al="True" ign="center">Foo</div></h1></body>Nr  r   r  rW  s   &  r   test_brokenAttributeName(BrokenHTMLTests.test_brokenAttributeName=  s    
 JS)r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  F  s     * *4 *r   c                0    RpRpV P                  W4       R# )z:
Check that microdom encompasses broken attribute values.
z6<body><h1><div align="cen!
 ter">Foo</div></h1></body>Nr  r  s   &  r   test_brokenAttributeValue)BrokenHTMLTests.test_brokenAttributeValueF  s     JL)r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  N  s     * *t *r   c                0    RpRpV P                  W4       R# )z}
Check that microdom does its best to handle broken opening tags.
The important thing is that it doesn't raise an exception.
z2<body><h1><sp!
 an>Hello World!</span></h1></body>z5<body><h1><sp an="True">Hello World!</sp></h1></body>Nr  r  s   &  r   test_brokenOpeningTag%BrokenHTMLTests.test_brokenOpeningTagN  s    
 FJ)r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  W  s     9 94 9r   c                N    V P                  RR4       V P                  RR4       R# )z
Check that microdom does its best to handle broken self-closing tags
The important thing is that it doesn't raise an exception.
z<body><span /!
></body>z<body><span></span></body>z
<span!
 />z<span></span>Nr  r   s   &r   test_brokenSelfClosingTag)BrokenHTMLTests.test_brokenSelfClosingTagW  s&    
 	35QR8r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  _  s     * *t *r   c                    RpRpV P                  W4       RpV P                  W4       RpV P                  W4       RpRpV P                  W4       R# )z}
Check that microdom does its best to handle broken closing tags.
The important thing is that it doesn't raise an exception.
z1<body><h1><span>Hello World!</sp!
an></h1></body>z/<body><h1><span>Hello World!</span></h1></body>z1<body><h1><span>Hello World!</!
span></h1></body>z1<body><h1><span>Hello World!</span!
></h1></body>z1<body><h1><span>Hello World!<!
/span></h1></body>z6<body><h1><span>Hello World!<!></!></span></h1></body>Nr  r  s   &  r   test_brokenClosingTag%BrokenHTMLTests.test_brokenClosingTag_  s[    
 ED)D)D)DK)r   r   N)   )r3   r4   r5   r6   __doc__r  r  r  r  r  r  r7   r   r   r   r  r  *  s+    C***9* *r   r  c                  2    ] tR tRtRtR R ltR R ltRtR# )		NodeTestsip  z
Tests for L{Node}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   NodeTests.__annotate__u  s     5 5D 5r   c                   \         P                  ! \        4       4      pV P                  VP	                  V4      4       \         P                  ! \        4       4      pV P                  VP	                  V4      4       VP                  \         P                  ! \        4       4      4       V P                  VP	                  V4      4       VP                  \         P                  ! \        4       4      4       V P                  VP	                  V4      4       VP                  4       P                  \         P                  ! \        4       4      4       V P                  VP	                  V4      4       VP                  4       P                  \         P                  ! \        4       4      4       V P                  VP	                  V4      4       R# )z_
L{Node.isEqualToNode} returns C{True} if and only if passed a L{Node}
with the same children.
N)r   Nodeobjectr   r   r  r'  rO   )r   r   anothers   &  r   test_isNodeEqualToNodeTests.test_isNodeEqualTou  s,    }}VX&**401--)**734vx01++G45HMM&(34 	**734 	%%hmmFH&=>++G45 	((vx)@A**734r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     D D Dr   c                   \         P                  ! 4       p\         P                  ! 4       pVP                  V4       V P                  \        VP                  R4       V P                  \        VP
                  VR4       V P                  \        VP
                  RV4       V P                  \        VP
                  RR4       VP                  V4       V P                  \        VP                  R4       V P                  \        VP                  VR4       V P                  \        VP                  RV4       V P                  \        VP                  RR4       R# )z?
Children of L{Node} instances must also be L{Node} instances.
N)r   r  r  r   	TypeErrorr  r  r	  )r   r   r  s   &  r   test_validChildInstance!NodeTests.test_validChildInstance  s    }})T%5%5t<)T%6%6tD)T%6%6eD)T%6%6dC)T%5%5t<)T%6%6tD)T%6%6eD)T%6%6dCr   r   N)r3   r4   r5   r6   r  r  r  r7   r   r   r   r  r  p  s    56D Dr   r  c                  6    ] tR tRtRtRtR R ltR R ltRtR	# )
DocumentTestsi  z
Tests for L{Document}.
r%  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   DocumentTests.__annotate__  s     : :D :r   c                   \         P                  ! 4       pV P                  VP                  V4      4       \         P                  ! 4       pV P                  VP                  V4      4       V P                  Vn        V P                  VP                  V4      4       V P                  Vn        V P                  VP                  V4      4       VP                  \         P                  ! \        4       4      4       V P                  VP                  V4      4       VP                  \         P                  ! \        4       4      4       V P                  VP                  V4      4       VP                  P                  \         P                  ! \        4       4      4       V P                  VP                  V4      4       R# )z
L{Document.isEqualToNode} returns C{True} if and only if passed a
L{Document} with the same C{doctype} and C{documentElement}.
N)
r   r  r   r   r&  r'  r  r  r  rm   )r   r  r  s   &  r   test_isEqualToNode DocumentTests.test_isEqualToNode  s7    $$&..x89 ##%..w78  <<//89,,..w78 	X]]6845//89HMM&(34..w78 	  ,,X]]68-DE//89r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     	E 	Et 	Er   c                    \         P                  ! 4       p\         P                  ! 4       p\         P                  ! 4       pVP                  V4       V P	                  \
        VP                  V4       R# )zS
L{Document.appendChild} raises L{ValueError} if the document already
has a child.
N)r   r  r  r  r   r  )r   r  r  r  s   &   r   test_childRestriction#DocumentTests.test_childRestriction  sN    
 $$&--/U#*h&:&:GDr   r   N)	r3   r4   r5   r6   r  r&  r  r  r7   r   r   r   r  r    s      FG:>	E 	Er   r  c                  &    ] tR tRtRtR R ltRtR# )EntityReferenceTestsi  z
Tests for L{EntityReference}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   !EntityReferenceTests.__annotate__  s     
 
D 
r   c                &   V P                  \        P                  ! R4      P                  \        P                  ! R4      4      4       V P	                  \        P                  ! R4      P                  \        P                  ! R4      4      4       R# )zt
L{EntityReference.isEqualToNode} returns C{True} if and only if passed
a L{EntityReference} with the same C{eref}.
quotaposN)r   r   r   r   r'  r   s   &r   r  'EntityReferenceTests.test_isEqualToNode  sn    
 	$$V,::((0	

 	$$V,::((0	
r   r   Nr3   r4   r5   r6   r  r  r7   r   r   r   r  r    s    
 
r   r  c                  &    ] tR tRtRtR R ltRtR# )CharacterDataTestsi  z
Tests for L{CharacterData}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   CharacterDataTests.__annotate__       

 

D 

r   c                &   V P                  \        P                  ! R4      P                  \        P                  ! R4      4      4       V P	                  \        P                  ! R4      P                  \        P                  ! R4      4      4       R# )zn
L{CharacterData.isEqualToNode} returns C{True} if and only if passed a
L{CharacterData} with the same value.
r   r   N)r   r   CharacterDatar   r'  r   s   &r   r  %CharacterDataTests.test_isEqualToNode  sh    
 	""5)778N8Nu8UV	
 	""5)778N8Nu8UV	
r   r   Nr"  r   r   r   r$  r$        

 

r   r$  c                  &    ] tR tRtRtR R ltRtR# )CommentTestsi   z
Tests for L{Comment}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   CommentTests.__annotate__  s     Y YD Yr   c                &   V P                  \        P                  ! R4      P                  \        P                  ! R4      4      4       V P	                  \        P                  ! R4      P                  \        P                  ! R4      4      4       R# )zb
L{Comment.isEqualToNode} returns C{True} if and only if passed a
L{Comment} with the same value.
r   r   N)r   r   r   r   r'  r   s   &r   r  CommentTests.test_isEqualToNode  sa    
 	((/==h>N>Nu>UVW))%0>>x?O?OPU?VWXr   r   Nr"  r   r   r   r-  r-     s    Y Yr   r-  c                  &    ] tR tRtRtR R ltRtR# )	TextTestsi  z
Tests for L{Text}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   TextTests.__annotate__  s     
 
D 
r   c           	        V P                  \        P                  ! RRR7      P                  \        P                  ! RRR7      4      4       V P	                  \        P                  ! RRR7      P                  \        P                  ! RRR7      4      4       V P	                  \        P                  ! RRR7      P                  \        P                  ! RRR7      4      4       R# )zg
L{Text.isEqualToNode} returns C{True} if and only if passed a L{Text}
which represents the same data.
r   Trq  Fr   N)r   r   r   r   r'  r   s   &r   r  TextTests.test_isEqualToNode  s    
 	MM%T*88uRV9WX	
 	MM%T*88e/	

 	MM%T*88uRV9WX	
r   r   Nr"  r   r   r   r3  r3    s    
 
r   r3  c                  &    ] tR tRtRtR R ltRtR# )CDATASectionTestsi%  z
Tests for L{CDATASection}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   CDATASectionTests.__annotate__*  r'  r   c                &   V P                  \        P                  ! R4      P                  \        P                  ! R4      4      4       V P	                  \        P                  ! R4      P                  \        P                  ! R4      4      4       R# )zw
L{CDATASection.isEqualToNode} returns C{True} if and only if passed a
L{CDATASection} which represents the same data.
r   r   N)r   r   r   r   r'  r   s   &r   r  $CDATASectionTests.test_isEqualToNode*  sh    
 	!!%(66x7L7LU7ST	
 	!!%(66x7L7LU7ST	
r   r   Nr"  r   r   r   r9  r9  %  r+  r   r9  c                  &    ] tR tRtRtR R ltRtR# )ElementTestsi7  z
Tests for L{Element}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ElementTests.__annotate__<  s     -
 -
D -
r   c                P   V P                  \        P                  ! RRR/\        4       RR7      P	                  \        P                  ! RRR/\        4       RR7      4      4       V P                  \        P                  ! RRR/\        4       RR7      P	                  \        P                  ! RRR/\        4       RR7      4      4       V P                  \        P                  ! RRR/\        4       RR7      P	                  \        P                  ! RRR/\        4       RR7      4      4       \        P                  ! RRR/\        4       RR7      p\        P                  ! RRR/\        4       RR7      pVP                  \        P                  ! \        4       4      4       V P                  VP	                  V4      4       V P                  \        P                  ! RRR/\        4       RR7      P	                  \        P                  ! RRR/\        4       RR7      4      4       R# )	z
L{Element.isEqualToNode} returns C{True} if and only if passed a
L{Element} with the same C{nodeName}, C{namespace}, C{childNodes}, and
C{attributes}.
r   rh   r   r   r  r   r   N)r   r   r   r  r   r'  r  r  )r   onetwos   &  r   r  ElementTests.test_isEqualToNode<  s    	Sz68um  c
FHN	
 	Sz68um  c
FHN	
 	Sz68um  c
FHN	
 usCj&(eLusCj&(eLfh/0**3/0 	Sz68um  c
FHN	
r   r   Nr"  r   r   r   r?  r?  7  s    -
 -
r   r?  N)r  
__future__r   	importlibr   ior   typingr   twisted.trial.unittestr   twisted.webr   r   r	   	XMLParserr   r9   rF   r  r  r  r  r$  r-  r3  r9  r?  r   r   r   <module>rM     s   
 #    + 1 1+CMM + 4x 4{
H {
|C*h C*L3D 3Dl/EH /Ed
8 
,
 
$Y8 Y
 
.
 
$2
8 2
r   