mς
­fIc           @   sΔ  d  k  Z  d k l Z d k l Z l Z d f  d     YZ d   Z e   Z e i	 d d  Z
 d e
 _ e e
 i d j  d	 e
 _ e e
 i d	 j  d
 e
 _ e e
 i d	 j  d e
 _ e e
 i d j  d e
 _ e e
 i d j  d	 e
 _ e e
 i d	 j  d
 e
 _ e e
 i d	 j  d e
 _ e e
 i d j  d e
 _ e e
 i d j  d	 e
 _ e e
 i d	 j  d
 e
 _ e e
 i d	 j  d e
 _ e e
 i d j  d d d d d d d d d d d d d d g Z x' e D] Z e e
 e e e e   qηWd Z d e
 _ y e
 i e d	  WnV e i j
 oG d Ge
 i Ge i e
 i  GHd Ge
 i GHd Ge
 i GHd Ge
 i GHn Xe i	 d d  Z
 d	 e
 _ x' e D] Z e e
 e e e e   q¨Wy e
 i e d	  WnV e i j
 oG d Ge
 i Ge i e
 i  GHd Ge
 i GHd Ge
 i GHd Ge
 i GHn Xe i	 d d  Z
 d	 e
 _ x' e D] Z e e
 e e e e   qZWd  k Z e i e  Z y e
 i e  WnV e i j
 oG d Ge
 i Ge i e
 i  GHd Ge
 i GHd Ge
 i GHd Ge
 i GHn XHd GHe i	   e i	 d d   e i	 d d  d  GHy e i	 d d!  Wn e j
 o Z d" GHe GHn Xd# GHy e i	 d d$  Wn e  j
 o Z d% GHe GHn Xd& GHe i	 d d'  e i	   Z! g  Z" d(   Z# e# e! _$ e# e! _% e! i d) d	  e" d Z& e' e"  d* j o d+ Ge' e"  GHn x8 e" D]0 Z( e& e( j	 o d, Gd- GHd. Ge) e"  GHPq.q.Wd  k* Z* d/ f  d0     YZ+ d1   Z, g  d2  Z- e-   \ Z
 Z. e, e
 i/ d3  e
 i d4 d	  e. i0 d5 g d6  e- d g  \ Z
 Z. e
 i d7 d	  e. i0 d8 d9 d: d; d< d= d> d? g d@  e-   \ Z
 Z. e
 i dA d	  e. i0 dB g d6  e- d g  \ Z
 Z. e
 i d4 d	  e. i0 d8 d9 d: d; d> d= g dC  e- d d g  \ Z
 Z. d  e
 _1 e
 i d4 d	  e. i0 d8 d: dD d> dE dF g dG  e- d d g  \ Z
 Z. e
 i dH d	  e. i0 d8 d9 d: dD d; d> dE d= dF g	 dG  e- d d d g  \ Z
 Z. e
 i dI d	  e. i0 d8 d9 d: dD d; d> dE dJ dF g	 dC  e- d d d g  \ Z
 Z. e
 i dK d	  e. i0 d8 d9 d: dD d; d> dE d= dL dM dN dO dF g dC  dP   Z$ e i	   Z
 e$ e
 _$ y e
 i dQ d	  Wn= e2 j
 o1 Z e i3 d dR j o dS e i3 d GHqpn XdT GHdU f  dV     YZ4 e i	   Z
 e4 da db dc dd de df g e
  Z. e
 i d` d	  d  S(g   N(   s   expat(   s   sortdicts
   TestFailedt	   Outputterc           B   s   t  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d	   Z
 d
   Z d   Z d   Z d   Z d   Z d   Z RS(   Nc         C   s   d Gt  |  Gt |  GHd  S(   Ns   Start element:
	(   t   reprt   namet   sortdictt   attrs(   t   selfR   R   (    (    t.   /mit/python/lib/python2.4/test/test_pyexpat.pyt   StartElementHandler   s    c         C   s   d Gt  |  GHd  S(   Ns   End element:
	(   R   R   (   R   R   (    (    R   t   EndElementHandler   s    c         C   s/   | i   } | o d GHd Gt |  GHn d  S(   Ns   Character data:s   	(   t   datat   stripR   (   R   R	   (    (    R   t   CharacterDataHandler   s    c         C   s   d Gt  |  Gt  |  GHd  S(   Ns   PI:
	(   R   t   targetR	   (   R   R   R	   (    (    R   t   ProcessingInstructionHandler   s    c         C   s   d Gt  |  Gt  |  GHd  S(   Ns
   NS decl:
	(   R   t   prefixt   uri(   R   R   R   (    (    R   t   StartNamespaceDeclHandler   s    c         C   s   d Gt  |  GHd  S(   Ns   End of NS decl:
	(   R   R   (   R   R   (    (    R   t   EndNamespaceDeclHandler   s    c         C   s	   d GHd  S(   Ns   Start of CDATA section(    (   R   (    (    R   t   StartCdataSectionHandler!   s    c         C   s	   d GHd  S(   Ns   End of CDATA section(    (   R   (    (    R   t   EndCdataSectionHandler$   s    c         C   s   d Gt  |  GHd  S(   Ns
   Comment:
	(   R   t   text(   R   R   (    (    R   t   CommentHandler'   s    c         G   s   | \ } } } } d G| GHd  S(   Ns   Notation declared:(   t   argsR   t   baset   sysidt   pubid(   R   R   R   R   R   R   (    (    R   t   NotationDeclHandler*   s    c         G   s"   | \ } } } } } d G| GHd  S(   Ns   Unparsed entity decl:
	(   R   t
   entityNameR   t   systemIdt   publicIdt   notationName(   R   R   R   R   R   R   R   (    (    R   t   UnparsedEntityDeclHandler.   s    c         C   s	   d GHd S(   Ns   Not standalonei   (    (   R   t   userData(    (    R   t   NotStandaloneHandler2   s    c         G   s#   | \ } } } } d G| d GHd S(   Ns   External entity ref:i   (   R   t   contextR   t   sysIdt   pubId(   R   R   R$   R#   R   R"   (    (    R   t   ExternalEntityRefHandler6   s    c         C   s   d  S(   N(    (   R   R    (    (    R   t   DefaultHandler;   s    c         C   s   d  S(   N(    (   R   R    (    (    R   t   DefaultHandlerExpand>   s    (   t   __name__t
   __module__R   R   R   R   R   R   R   R   R   R   R   R!   R%   R&   R'   (    (    (    R   R       s   														c         C   s   |  o	 d GHn d GHd  S(   Ns   OK.s   Not OK.(   t   ok(   R*   (    (    R   t   confirmB   s    	t   namespace_separatort   !i    i   i   R   R   R   R   R   R   R   R   R   R   R   R&   R'   R%   sn  <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<?xml-stylesheet href="stylesheet.css"?>
<!-- comment data -->
<!DOCTYPE quotations SYSTEM "quotations.dtd" [
<!ELEMENT root ANY>
<!NOTATION notation SYSTEM "notation.jpeg">
<!ENTITY acirc "&#226;">
<!ENTITY external_entity SYSTEM "entity.file">
<!ENTITY unparsed_entity SYSTEM "entity.file" NDATA notation>
%unparsed_entity;
]>

<root attr1="value1" attr2="value2&#8000;">
<myns:subelement xmlns:myns="http://www.python.org/namespace">
     Contents of subelements
</myns:subelement>
<sub2><![CDATA[contents of CDATA section]]></sub2>
&external_entity;
</root>
s   ** Errors   ** Lines	   ** Columns   ** BytesF   Testing constructor for proper handling of namespace_separator values:t    s   Legal values tested o.k.i*   s   Caught expected TypeError:s#   Failed to catch expected TypeError.s   too longs   Caught expected ValueError:s$   Failed to catch expected ValueError.t    c         G   s   t  i |   d  S(   N(   t   Lt   appendR   (   R   R   (    (    R   t	   collectorΟ   s    s   <e> <e/> <e></e> </e>i   s&   L should only contain 6 entries; founds8   expected L to contain many references to the same strings   (it didn't)s   L =t   TextCollectorc           B   s>   t  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   Nc         C   s   g  |  _ d  S(   N(   R   t   stuff(   R   t   parser(    (    R   t   __init__β   s    c         C   s3   t  |  i | j d | |  i t t |  f  d  S(   Ns   %s
stuff    = %r
expected = %r(   t   requireR   R4   t   expectedt   labelt   mapt   unicode(   R   R8   R9   (    (    R   t   checkε   s    c         C   s   |  i i |  d  S(   N(   R   R4   R1   R   (   R   R   (    (    R   R   κ   s    c         C   s[   |  i i d |  | i d  } | d j o d t _ n | d j o d t _ n d  S(   Ns   <%s>s   buffer-textt   yesi   t   noi    (	   R   R4   R1   R   R   t   gett   btR5   t   buffer_text(   R   R   R   R@   (    (    R   R   ν   s    c         C   s   |  i i d |  d  S(   Ns   </%s>(   R   R4   R1   R   (   R   R   (    (    R   R   υ   s    c         C   s   |  i i d |  d  S(   Ns	   <!--%s-->(   R   R4   R1   R	   (   R   R	   (    (    R   R   ψ   s    (   R(   R)   R6   R<   R   R   R   R   (    (    (    R   R3   α   s   					c         C   s   |  p t |   n d  S(   N(   t   condt
   TestFailedR9   (   RB   R9   (    (    R   R7   ϋ   s    c         C   sr   t  i   } t | i d  d | _ t |  } | i | _ x' |  D] } t
 | | t | |   qE W| | f S(   Ns#   buffer_text not disabled by defaulti   (   t   expatt   ParserCreateR5   R7   RA   R3   t   handlerR   t   handlersR   t   setattrt   getattr(   RG   R   R5   RF   (    (    R   t   setup   s    
	 s5   text buffering either not acknowledged or not enableds   <a>1<b/>2<c/>3</a>t   123s$   buffered text not properly collapseds9   <a>1<b buffer-text='no'/>2
3<c buffer-text='yes'/>4
5</a>s   <a>t   1s   <b>t   2s   
t   3s   <c>s   4
5s*   buffering control not reacting as expecteds&   <a>1<b/>&lt;2&gt;<c/>&#32;
&#x20;3</a>s   1<2> 
 3s    buffered text not properly splits   </b>s   </c>s   </a>s   huh?s   <a>1<b></b>2<c/>3</a>s   <a>1<b/>2<c></c>345</a> t   345s,   <a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> s
   <!--abc-->t   4s
   <!--def-->t   5c         C   s   t  |    d  S(   N(   t   RuntimeErrorR   (   R   R   (    (    R   R   <  s    s   <a><b><c/></b></a>t   as/   Expected RuntimeError for element 'a'; found %rs   Expected RuntimeError for 'a't   PositionTestc           B   s,   t  Z d   Z d   Z d   Z d   Z RS(   Nc         C   s=   | |  _  |  i |  i  _ |  i |  i  _ | |  _ d |  _ d  S(   Ni    (   R5   R   R   R   t   expected_listt   upto(   R   RU   R5   (    (    R   R6   M  s
    		c         C   s   |  i d  d  S(   Nt   s(   R   t	   check_pos(   R   R   R   (    (    R   R   T  s    c         C   s   |  i d  d  S(   Nt   e(   R   RX   (   R   R   (    (    R   R   W  s    c         C   s   | |  i i |  i i |  i i f } t |  i t	 |  i
  j  d  |  i
 |  i } t | | j d | | f  |  i d 7_ d  S(   Ns   too many parser eventss   expected position %s, got %si   (   t   eventR   R5   t   CurrentByteIndext   CurrentLineNumbert   CurrentColumnNumbert   posR7   RV   t   lenRU   R8   (   R   RZ   R^   R8   (    (    R   RX   Z  s    $(   R(   R)   R6   R   R   RX   (    (    (    R   RT   K  s   			RW   i   i   i   RY   i   i   i   i   s   <a>
 <b>
  <c/>
 </b>
</a>(   RW   i    i   i    (   RW   i   i   i   (   RW   i   i   i   (   RY   i   i   i   (   RY   i   i   i   (   RY   i   i   i    (5   t   pyexpatt   xml.parsersRD   t   test.test_supportR   RC   R    R+   t   outRE   R5   t   returns_unicodet   ordered_attributest   specified_attributest   HANDLER_NAMESR   RH   RI   R	   t   Parset   errort	   ErrorCodet   ErrorStringt   ErrorLineNumbert   ErrorColumnNumbert   ErrorByteIndext   StringIOt   filet	   ParseFilet   Nonet	   TypeErrorRY   t
   ValueErrort   pR0   R2   R   R   t   tagR_   t   entryR   t   sysR3   R7   RJ   RF   RA   R<   R   RR   R   RT   (   R5   Rv   Rp   R`   R2   Rc   R+   RF   RC   RD   R   R0   Rx   R3   R	   RT   R    RY   R   Ro   R7   Ru   Rw   R   Rg   RJ   (    (    R   t   ?   s"  	7		0 		 	 	



			
 				!	$$0			