ó
‹wÛjc           @   s–  d  d l  Z  d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m Z m	 Z	 d e j
 f d „  ƒ  YZ d Z d e j
 f d	 „  ƒ  YZ d
 e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d e j
 f d „  ƒ  YZ d „  Z e d k r’e ƒ  n  d S(   iÿÿÿÿN(   t   expat(   t   test_support(   t   sortdictt   run_unittestt   SetAttributeTestc           B   sG   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  j d d ƒ |  _ d  S(   Nt   namespace_separatort   !(   R    t   ParserCreatet   parser(   t   self(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   setUp   s    c         C   sS   |  j  |  j j t ƒ x6 d D]. } | |  j _ |  j  |  j j t | ƒ ƒ q Wd  S(   Ni    i   i   (   i    i   i   i    (   t   assertIsR   t   buffer_textt   Falset   bool(   R	   t   x(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_buffer_text   s    c         C   sS   |  j  |  j j t ƒ x6 d D]. } | |  j _ |  j  |  j j t | ƒ ƒ q Wd  S(   Ni    i   i   (   i    i   i   i    (   R   R   t   namespace_prefixesR   R   (   R	   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_namespace_prefixes   s    c         C   sV   |  j  |  j j t j ƒ x6 d D]. } | |  j _ |  j  |  j j t | ƒ ƒ q  Wd  S(   Ni    i   i   (   i    i   i   i    (   R   R   t   returns_unicodeR   t   have_unicodeR   (   R	   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_returns_unicode   s    c         C   sS   |  j  |  j j t ƒ x6 d D]. } | |  j _ |  j  |  j j t | ƒ ƒ q Wd  S(   Ni    i   i   (   i    i   i   i    (   R   R   t   ordered_attributesR   R   (   R	   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_ordered_attributes#   s    c         C   sS   |  j  |  j j t ƒ x6 d D]. } | |  j _ |  j  |  j j t | ƒ ƒ q Wd  S(   Ni    i   i   (   i    i   i   i    (   R   R   t   specified_attributesR   R   (   R	   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_specified_attributes)   s    c         C   sF   |  j  t ƒ � d |  j _ Wd  QX|  j  t ƒ � |  j j Wd  QXd  S(   Ni   (   t   assertRaisest   AttributeErrorR   t   foo(   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_invalid_attributes/   s    (	   t   __name__t
   __module__R
   R   R   R   R   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR      s   						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>
t	   ParseTestc           B   so   e  Z d  d d „  ƒ  YZ d d d d d d d d	 d
 d d d d d g Z d „  Z d „  Z d „  Z d „  Z RS(   t	   Outputterc           B   s˜   e  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 d „  Z RS(   c         C   s   g  |  _  d  S(   N(   t   out(   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   __init__P   s    c         C   s,   |  j  j d t | ƒ d t | ƒ ƒ d  S(   Ns   Start element: t    (   R"   t   appendt   reprR   (   R	   t   namet   attrs(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   StartElementHandlerS   s    c         C   s   |  j  j d t | ƒ ƒ d  S(   Ns   End element: (   R"   R%   R&   (   R	   R'   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   EndElementHandlerW   s    c         C   s3   | j  ƒ  } | r/ |  j j d t | ƒ ƒ n  d  S(   Ns   Character data: (   t   stripR"   R%   R&   (   R	   t   data(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   CharacterDataHandlerZ   s    c         C   s,   |  j  j d t | ƒ d t | ƒ ƒ d  S(   Ns   PI: R$   (   R"   R%   R&   (   R	   t   targetR,   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   ProcessingInstructionHandler_   s    c         C   s,   |  j  j d t | ƒ d t | ƒ ƒ d  S(   Ns	   NS decl: R$   (   R"   R%   R&   (   R	   t   prefixt   uri(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   StartNamespaceDeclHandlerb   s    c         C   s   |  j  j d t | ƒ ƒ d  S(   Ns   End of NS decl: (   R"   R%   R&   (   R	   R0   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   EndNamespaceDeclHandlere   s    c         C   s   |  j  j d ƒ d  S(   Ns   Start of CDATA section(   R"   R%   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   StartCdataSectionHandlerh   s    c         C   s   |  j  j d ƒ d  S(   Ns   End of CDATA section(   R"   R%   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   EndCdataSectionHandlerk   s    c         C   s   |  j  j d t | ƒ ƒ d  S(   Ns	   Comment: (   R"   R%   R&   (   R	   t   text(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   CommentHandlern   s    c         G   s-   | \ } } } } |  j  j d | f ƒ d  S(   Ns   Notation declared: %s(   R"   R%   (   R	   t   argsR'   t   baset   sysidt   pubid(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   NotationDeclHandlerq   s    c         G   s0   | \ } } } } } |  j  j d | f ƒ d  S(   Ns   Unparsed entity decl: %s(   R"   R%   (   R	   R8   t
   entityNameR9   t   systemIdt   publicIdt   notationName(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   UnparsedEntityDeclHandleru   s    c         C   s   |  j  j d ƒ d S(   Ns   Not standalonei   (   R"   R%   (   R	   t   userData(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   NotStandaloneHandlery   s    c         G   s1   | \ } } } } |  j  j d | d f ƒ d S(   Ns   External entity ref: %si   (   R"   R%   (   R	   R8   t   contextR9   t   sysIdt   pubId(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   ExternalEntityRefHandler}   s    c         C   s   d  S(   N(    (   R	   RB   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   DefaultHandler‚   s    c         C   s   d  S(   N(    (   R	   RB   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   DefaultHandlerExpand…   s    (   R   R   R#   R)   R*   R-   R/   R2   R3   R4   R5   R7   R<   RA   RC   RG   RH   RI   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR!   O   s    															R)   R*   R-   R/   RA   R<   R2   R3   R7   R4   R5   RH   RI   RG   c         C   sÅ  |  j  ƒ  } t j d d ƒ } x* |  j D] } t | | t | | ƒ ƒ q( Wd | _ | j t d ƒ | j	 } |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d	 d
 ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d  ƒ |  j
 | d! d" ƒ |  j
 | d# d$ ƒ d  S(%   NR   R   i    i   s,   PI: 'xml-stylesheet' 'href="stylesheet.css"'s   Comment: ' comment data 'i   s<   Notation declared: ('notation', None, 'notation.jpeg', None)i   sP   Unparsed entity decl: ('unparsed_entity', None, 'entity.file', None, 'notation')i   sH   Start element: 'root' {'attr1': 'value1', 'attr2': 'value2\xe1\xbd\x80'}i   s1   NS decl: 'myns' 'http://www.python.org/namespace'i   s>   Start element: 'http://www.python.org/namespace!subelement' {}i   s)   Character data: 'Contents of subelements'i   s9   End element: 'http://www.python.org/namespace!subelement'i	   s   End of NS decl: 'myns'i
   s   Start element: 'sub2' {}i   s   Start of CDATA sectioni   s+   Character data: 'contents of CDATA section'i   s   End of CDATA sectioni   s   End element: 'sub2'i   s0   External entity ref: (None, 'entity.file', None)i   s   End element: 'root'(   R!   R    R   t   handler_namest   setattrt   getattrR   t   ParseR,   R"   t   assertEqual(   R	   R"   R   R'   t   op(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt	   test_utf8”   s0    		c         C   sÅ  |  j  ƒ  } t j d d ƒ } d | _ x* |  j D] } t | | t | | ƒ ƒ q1 W| j t d ƒ | j	 } |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d	 d
 ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d ƒ |  j
 | d d  ƒ |  j
 | d! d" ƒ |  j
 | d# d$ ƒ d  S(%   NR   R   i   i    s.   PI: u'xml-stylesheet' u'href="stylesheet.css"'s   Comment: u' comment data 'i   s>   Notation declared: (u'notation', None, u'notation.jpeg', None)i   sS   Unparsed entity decl: (u'unparsed_entity', None, u'entity.file', None, u'notation')i   sG   Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\u1f40'}i   s3   NS decl: u'myns' u'http://www.python.org/namespace'i   s?   Start element: u'http://www.python.org/namespace!subelement' {}i   s*   Character data: u'Contents of subelements'i   s:   End element: u'http://www.python.org/namespace!subelement'i	   s   End of NS decl: u'myns'i
   s   Start element: u'sub2' {}i   s   Start of CDATA sectioni   s,   Character data: u'contents of CDATA section'i   s   End of CDATA sectioni   s   End element: u'sub2'i   s1   External entity ref: (None, u'entity.file', None)i   s   End element: u'root'(   R!   R    R   R   RJ   RK   RL   RM   R,   R"   RN   (   R	   R"   R   R'   RO   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_unicode±   s0    		c         C   s4  |  j  ƒ  } t j d d ƒ } d | _ x* |  j D] } t | | t | | ƒ ƒ q1 Wt j t ƒ } | j	 | ƒ | j
 } |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d	 d
 ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d ƒ |  j | d d  ƒ |  j | d! d" ƒ |  j | d# d$ ƒ t t j d% ƒ } z= | j ƒ  t j ƒ  } |  j t ƒ � | j	 | ƒ Wd  QXWd  t j t j ƒ Xd  S(&   NR   R   i   i    s.   PI: u'xml-stylesheet' u'href="stylesheet.css"'s   Comment: u' comment data 'i   s>   Notation declared: (u'notation', None, u'notation.jpeg', None)i   sS   Unparsed entity decl: (u'unparsed_entity', None, u'entity.file', None, u'notation')i   sG   Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\u1f40'}i   s3   NS decl: u'myns' u'http://www.python.org/namespace'i   s?   Start element: u'http://www.python.org/namespace!subelement' {}i   s*   Character data: u'Contents of subelements'i   s:   End element: u'http://www.python.org/namespace!subelement'i	   s   End of NS decl: u'myns'i
   s   Start element: u'sub2' {}i   s   Start of CDATA sectioni   s,   Character data: u'contents of CDATA section'i   s   End of CDATA sectioni   s   End element: u'sub2'i   s1   External entity ref: (None, u'entity.file', None)i   s   End element: u'root't   wb(   R!   R    R   R   RJ   RK   RL   t   StringIOR,   t	   ParseFileR"   RN   t   openR   t   TESTFNt   closeR   t
   ValueErrort   unlink(   R	   R"   R   R'   t   fileRO   t   fp(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_parse_fileÎ   s@    		
c         C   sy   t  j ƒ  } t j t ƒ } | j | ƒ |  j t  j ƒ � } | j | ƒ Wd  QX|  j t  j | j	 j
 ƒ t  j j ƒ d  S(   N(   R    R   RS   R,   RT   R   t   errorRN   t   ErrorStringt	   exceptiont   codet   errorst   XML_ERROR_FINISHED(   R	   R   RZ   t   cm(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_parse_againö   s    (    (   R   R   R!   RJ   RP   RQ   R\   Rd   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR    N   s   :				(t   NamespaceSeparatorTestc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s.   t  j ƒ  t  j d d  ƒ t  j d d ƒ d  S(   NR   R$   (   R    R   t   None(   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt
   test_legal  s    
c         C   s˜   y t  j d d ƒ |  j ƒ  Wn) t k
 rI } |  j t | ƒ d ƒ n Xy t  j d d ƒ |  j ƒ  Wn) t k
 r“ } |  j t | ƒ d ƒ n Xd  S(   NR   i*   s9   ParserCreate() argument 2 must be string or None, not ints   too longsC   namespace_separator must be at most one character, omitted, or None(   R    R   t   failt	   TypeErrorRN   t   strRX   (   R	   t   e(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_illegal
  s    c         C   s   t  j d d ƒ d  S(   NR   t    (   R    R   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_zero_length  s    	(   R   R   Rg   Rl   Rn   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRe     s   		t   InterningTestc           B   s   e  Z d  „  Z RS(   c            s‹   t  j ƒ  } g  ‰  ‡  f d †  } | | _ | | _ | j d d ƒ ˆ  d } |  j t ˆ  ƒ d ƒ x! ˆ  D] } |  j | | k ƒ qj Wd  S(   Nc            s   ˆ  j  |  ƒ d  S(   N(   R%   (   R'   R8   (   t   L(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt	   collector*  s    s   <e> <e/> <e></e> </e>i   i    i   (   R    R   R)   R*   RM   RN   t   lent
   assertTrue(   R	   t   pRq   t   tagt   entry(    (   Rp   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test&  s    		
(   R   R   Rw   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRo   %  s   t   BufferTextTestc           B   s›   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z g  d „ Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s7   g  |  _  t j ƒ  |  _ d |  j _ |  j |  j _ d  S(   Ni   (   t   stuffR    R   R   R   R-   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR
   7  s    	c      	   C   s3   |  j  |  j | d | |  j t t | ƒ f ƒ d  S(   Ns   %s
stuff    = %r
expected = %r(   RN   Ry   t   mapt   unicode(   R	   t   expectedt   label(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   check=  s    c         C   s   |  j  j | ƒ d  S(   N(   Ry   R%   (   R	   R6   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR-   B  s    c         C   s]   |  j  j d | ƒ | j d ƒ } | d k r> d |  j _ n | d k rY d |  j _ n  d  S(   Ns   <%s>s   buffer-textt   yesi   t   noi    (   Ry   R%   t   getR   R   (   R	   R'   R(   t   bt(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR)   E  s    c         C   s   |  j  j d | ƒ d  S(   Ns   </%s>(   Ry   R%   (   R	   R'   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR*   M  s    c         C   s   |  j  j d | ƒ d  S(   Ns	   <!--%s-->(   Ry   R%   (   R	   R,   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR7   P  s    c         C   s1   x* | D]" } t  |  j | t |  | ƒ ƒ q Wd  S(   N(   RK   R   RL   (   R	   t   handlersR'   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   setHandlersS  s    c         C   s    t  j ƒ  } |  j | j ƒ d  S(   N(   R    R   t   assertFalseR   (   R	   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_default_to_disabledW  s    c         C   sC   |  j  |  j j ƒ |  j j d d ƒ |  j |  j d g d ƒ d  S(   Ns   <a>1<b/>2<c/>3</a>i   t   123s$   buffered text not properly collapsed(   Rs   R   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_buffering_enabled[  s    c      
   C   sU   |  j  d g ƒ |  j j d d ƒ |  j |  j d d d d d d	 d
 d g d ƒ d  S(   NR)   s9   <a>1<b buffer-text='no'/>2
3<c buffer-text='yes'/>4
5</a>i   s   <a>t   1s   <b>t   2s   
t   3s   <c>s   4
5s*   buffering control not reacting as expected(   R„   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test1b  s
    c         C   s0   |  j  j d d ƒ |  j |  j d g d ƒ d  S(   Ns&   <a>1<b/>&lt;2&gt;<c/>&#32;
&#x20;3</a>i   s   1<2> 
 3s$   buffered text not properly collapsed(   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test2k  s    c         C   sO   |  j  d g ƒ |  j j d d ƒ |  j |  j d d d d d d	 g d
 ƒ d  S(   NR)   s   <a>1<b/>2<c/>3</a>i   s   <a>R‰   s   <b>RŠ   s   <c>R‹   s    buffered text not properly split(   R„   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test3p  s    !c         C   s[   |  j  d d g ƒ d  |  j _ |  j j d d ƒ |  j |  j d d d d d	 d
 g ƒ d  S(   NR)   R*   s   <a>1<b/>2<c/>3</a>i   s   <a>s   <b>s   </b>s   <c>s   </c>s   </a>(   R„   Rf   R   R-   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test4v  s
    c         C   sX   |  j  d d g ƒ |  j j d d ƒ |  j |  j d d d d d	 d
 d d d g	 ƒ d  S(   NR)   R*   s   <a>1<b></b>2<c/>3</a>i   s   <a>R‰   s   <b>s   </b>RŠ   s   <c>s   </c>R‹   s   </a>(   R„   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test5}  s    c         C   s^   |  j  d d d g ƒ |  j j d d ƒ |  j |  j d d d d	 d
 d d d d g	 d ƒ d  S(   NR7   R*   R)   s   <a>1<b/>2<c></c>345</a> i   s   <a>R‰   s   <b>s   </b>RŠ   s   <c>s   </c>t   345s   </a>s    buffered text not properly split(   R„   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test6ƒ  s    
c         C   sj   |  j  d d d g ƒ |  j j d d ƒ |  j |  j d d d d	 d
 d d d d d d d d g d ƒ d  S(   NR7   R*   R)   s,   <a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> i   s   <a>R‰   s   <b>s   </b>RŠ   s   <c>s   </c>R‹   s
   <!--abc-->t   4s
   <!--def-->t   5s   </a>s    buffered text not properly split(   R„   R   RM   RN   Ry   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test7‹  s    
(   R   R   R
   R~   R-   R)   R*   R7   R„   R†   Rˆ   RŒ   R�   RŽ   R�   R�   R’   R•   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRx   6  s    															t   HandlerExceptionTestc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  | ƒ ‚ d  S(   N(   t   RuntimeError(   R	   R'   R(   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR)   —  s    c         C   sy   t  j ƒ  } |  j | _ y | j d d ƒ |  j ƒ  Wn< t k
 rt } |  j | j d d d d | j d ƒ n Xd  S(   Ns   <a><b><c/></b></a>i   i    t   as*   Expected RuntimeError for element 'a', buts	    found %r(   R    R   R)   RM   Rh   R—   RN   R8   (   R	   R   Rk   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRw   š  s    (   R   R   R)   Rw   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR–   –  s   	t   PositionTestc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   |  j  d ƒ d  S(   Nt   s(   t	   check_pos(   R	   R'   R(   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR)   ¨  s    c         C   s   |  j  d ƒ d  S(   NRk   (   R›   (   R	   R'   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR*   «  s    c         C   s†   | |  j  j |  j  j |  j  j f } |  j |  j t |  j ƒ k  d ƒ |  j |  j } |  j | | d | | f ƒ |  j d 7_ d  S(   Ns   too many parser eventss%   Expected position %s, got position %si   (	   R   t   CurrentByteIndext   CurrentLineNumbert   CurrentColumnNumberRs   t   uptoRr   t   expected_listRN   (   R	   t   eventt   posR|   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR›   ®  s    		c      	   C   sn   t  j ƒ  |  _ |  j |  j _ |  j |  j _ d |  _ d d d d d d g |  _ d } |  j j | d ƒ d  S(   Ni    Rš   i   i   i   i   i   Rk   i   i   i   i   i   s   <a>
 <b>
  <c/>
 </b>
</a>(   Rš   i    i   i    (   Rš   i   i   i   (   Rš   i   i   i   (   Rk   i   i   i   (   Rk   i   i   i   (   Rk   i   i   i    (   R    R   R   R)   R*   RŸ   R    RM   (   R	   t   xml(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRw   º  s    		(   R   R   R)   R*   R›   Rw   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR™   §  s   			t   sf1296433Testc           B   s   e  Z d  „  Z RS(   c            sb   d d d } d t  f d „  ƒ  Y‰  ‡  f d †  } t j ƒ  } | | _ |  j t  | j | ƒ d  S(   Ns1   <?xml version='1.0' encoding='iso8859'?><s>%s</s>R˜   i  t   SpecificExceptionc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR¥   Î  s   c            s
   ˆ  ‚ d  S(   N(    (   R6   (   R¥   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   handlerÑ  s    (   t	   ExceptionR    R   R-   R   RM   (   R	   R£   R¦   R   (    (   R¥   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_parse_only_xml_dataÇ  s    	(   R   R   R¨   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR¤   Æ  s   t   ChardataBufferTestc           B   sh   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z RS(   s.   
    test setting of chardata buffer size
    c         C   s   |  j  |  j d ƒ d ƒ d  S(   Ni  i   (   RN   t   small_buffer_test(   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_1025_bytesÞ  s    c         C   s   |  j  |  j d ƒ d ƒ d  S(   Niè  i   (   RN   Rª   (   R	   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_1000_bytesá  s    c      	   C   sœ   t  j ƒ  } d | _ |  j t ƒ � d | _ Wd  QX|  j t ƒ � d | _ Wd  QX|  j t ƒ � d | _ Wd  QX|  j t ƒ � t j d | _ Wd  QXd  S(   Ni   iÿÿÿÿi    g      €@(	   R    R   R   R   RX   t   buffer_sizeRi   t   syst   maxint(   R	   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_wrong_sizeä  s    	c         C   s²   d d d } d d d } t  j ƒ  } |  j | _ d | _ d | _ d |  _ | j | ƒ |  j |  j d ƒ | j | _ |  j |  j d ƒ | j | ƒ |  j |  j d ƒ d  S(   Ns-   <?xml version='1.0' encoding='iso8859'?><s>%sR˜   i   s   </s>i   i    i   (	   R    R   t   counting_handlerR-   R­   R   t   nRM   RN   (   R	   t   xml1t   xml2R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_unchanged_sizeð  s    			c         C   s[  d d d } d d } d d d } t  j ƒ  } |  j | _ d | _ d | _ |  j | j d ƒ d	 |  _ | j | d	 ƒ |  j | j d ƒ |  j |  j d ƒ d	 | _ |  j	 | j ƒ |  j | j d ƒ x$ t
 d
 ƒ D] } | j | d	 ƒ qÛ W|  j |  j d ƒ d | _ |  j | j ƒ |  j | j d ƒ | j | d ƒ |  j |  j d ƒ d  S(   Ns-   <?xml version='1.0' encoding='iso8859'?><a>%sR˜   i   t   bi   s   %s</a>t   ci   i    i
   i   i   (   R    R   R±   R-   R   R­   RN   R²   RM   R…   t   rangeRs   (   R	   R³   R´   t   xml3R   t   i(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_disabling_buffer  s.    
					c         C   s   d | d d S(   Ns   <?xml version='1.0'?><tag>R˜   s   </tag>(    (   R	   t   bytes(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   make_document'  s    c         C   s   |  j  d 7_  d  S(   Ni   (   R²   (   R	   R6   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR±   *  s    c         C   sU   d d | } t  j ƒ  } |  j | _ d | _ d | _ d |  _ | j | ƒ |  j S(   Ns1   <?xml version='1.0' encoding='iso8859'?><s>%s</s>R˜   i   i   i    (   R    R   R±   R-   R­   R   R²   RM   (   R	   t
   buffer_lenR£   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRª   -  s    			c         C   s»   d d d } d d d } t  j ƒ  } |  j | _ d | _ d | _ |  j | j d ƒ d |  _ | j | d ƒ | j d 9_ |  j | j d	 ƒ | j | d ƒ |  j |  j d ƒ d  S(
   Ns0   <?xml version='1.0' encoding='iso8859'?><a><s>%sR˜   i   s   aaa</s><s>%s</s></a>i  i   i    i   i   (	   R    R   R±   R-   R   R­   RN   R²   RM   (   R	   R³   R´   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_change_size_18  s    			c         C   s»   d d d } d d d } t  j ƒ  } |  j | _ d | _ d | _ |  j | j d ƒ d |  _ | j | d ƒ | j d	 _ |  j | j d
 ƒ | j | d ƒ |  j |  j d ƒ d  S(   Ns1   <?xml version='1.0' encoding='iso8859'?><a>a<s>%sR˜   iÿ  s   aaa</s><s>%s</s></a>i  i   i   i    i   i   i   (	   R    R   R±   R-   R   R­   RN   R²   RM   (   R	   R³   R´   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_change_size_2H  s    			(   R   R   t   __doc__R«   R¬   R°   Rµ   R»   R½   R±   Rª   R¿   RÀ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR©   Ù  s   					 				t   MalformedInputTextc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sc   d } t  j ƒ  } y | j | t ƒ |  j ƒ  Wn, t  j k
 r^ } |  j t | ƒ d ƒ n Xd  S(   Ns    
s    unclosed token: line 2, column 0(   R    R   RM   t   TrueRh   t
   ExpatErrorRN   Rj   (   R	   R£   R   Rk   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRŒ   Y  s    c         C   sH   d } t  j ƒ  } d } |  j t  j | ƒ � | j | t ƒ Wd  QXd  S(   Ns   <?xml versionÂ…='1.0'?>
s3   XML declaration not well-formed: line 1, column \d+(   R    R   t   assertRaisesRegexpRÄ   RM   RÃ   (   R	   R£   R   t   err_pattern(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyR�   b  s
    (   R   R   RŒ   R�   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRÂ   X  s   		t   ForeignDTDTestsc           B   s    e  Z d  Z d „  Z d „  Z RS(   sE   
    Tests for the UseForeignDTD method of expat parser objects.
    c            sÁ   g  ‰  ‡  f d †  } t  j ƒ  } | j t ƒ | j t  j ƒ | | _ | j d ƒ |  j ˆ  d g ƒ g  ˆ  (t  j ƒ  } | j ƒ  | j t  j ƒ | | _ | j d ƒ |  j ˆ  d g ƒ d S(   sÒ   
        If UseForeignDTD is passed True and a document without an external
        entity reference is parsed, ExternalEntityRefHandler is first called
        with None for the public and system ids.
        c            s   ˆ  j  | | f ƒ d S(   Ni   (   R%   (   RD   R9   t	   system_idt	   public_id(   t   handler_call_args(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   resolve_entityt  s    s   <?xml version='1.0'?><element/>N(   NN(   NN(
   R    R   t   UseForeignDTDRÃ   t   SetParamEntityParsingt   XML_PARAM_ENTITY_PARSING_ALWAYSRG   RM   RN   Rf   (   R	   RË   R   (    (   RÊ   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_use_foreign_dtdm  s    	
	c            sk   g  ‰  ‡  f d †  } t  j ƒ  } | j t ƒ | j t  j ƒ | | _ | j d ƒ |  j ˆ  d g ƒ d S(   sÒ   
        If UseForeignDTD is passed True and a document with an external
        entity reference is parsed, ExternalEntityRefHandler is called with
        the public and system ids from the document.
        c            s   ˆ  j  | | f ƒ d S(   Ni   (   R%   (   RD   R9   RÈ   RÉ   (   RÊ   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRË   �  s    s@   <?xml version='1.0'?><!DOCTYPE foo PUBLIC 'bar' 'baz'><element/>t   bart   bazN(   RÐ   RÑ   (	   R    R   RÌ   RÃ   RÍ   RÎ   RG   RM   RN   (   R	   RË   R   (    (   RÊ   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   test_ignore_use_foreign_dtd‰  s    	(   R   R   RÁ   RÏ   RÒ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyRÇ   i  s   	c           C   s,   t  t t t t t t t t t	 t
 t ƒ d  S(   N(   R   R   R    Re   Ro   Rx   R–   R™   R¤   R©   RÂ   RÇ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt	   test_main�  s    t   __main__(   RS   R®   t   unittestt   xml.parsersR    Rw   R   t   test.test_supportR   R   t   TestCaseR   R,   R    Re   Ro   Rx   R–   R™   R¤   R©   RÂ   RÇ   RÓ   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_pyexpat.pyt   <module>   s&   =´#`4	