σ
ίΘ[c           @` s   d  d l  m Z m Z m Z m Z d d l m Z d d l m Z d  d l	 Z	 d Z
 d Z d Z e
 d	 e e Z d
 e f d     YZ d   Z d S(   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsi   (   t   _fast_iterparse(   t   sixNu―   <?xml version="1.0" encoding="UTF-8"?>
<VOTABLE>
 <RESOURCE type="results">
  <TABLE>
   <FIELD ID="foo" name="foo" datatype="int" arraysize="1"/>
    <DATA>
     <TABLEDATA>
u   <TR><TD>0</TD></TR>
u@   
    </TABLEDATA>
   </DATA>
  </TABLE>
 </RESOURCE>
</VOTABLE>
i}   t   UngzipFileWrapperc           B` s#   e  Z d    Z d   Z d   Z RS(   c         K` s&   | |  _  t j d t j  |  _ d  S(   Ni   (   t   _filet   zlibt   decompressobjt	   MAX_WBITSt   _z(   t   selft   fdt   kwargs(    (    sE   lib/python2.7/site-packages/astropy/utils/xml/tests/test_iterparse.pyt   __init__T   s    	c         C` s_   t  d t d |   } |  j j |  } |  j j |  } t |  d k r[ |  j   n  | S(   Ni   i   i    i   (   t   maxt   minR   t   readR   t
   decompresst   lent   close(   R   t   requested_lengtht   clamped_lengtht
   compressedt	   plaintext(    (    sE   lib/python2.7/site-packages/astropy/utils/xml/tests/test_iterparse.pyR   X   s    c         C` s   t  |  j |  S(   N(   t   getattrR   (   R   t   attr(    (    sE   lib/python2.7/site-packages/astropy/utils/xml/tests/test_iterparse.pyt   __getattr__b   s    (   t   __name__t
   __module__R   R   R   (    (    (    sE   lib/python2.7/site-packages/astropy/utils/xml/tests/test_iterparse.pyR   S   s   		
c          C` s   d }  t  j t  j t  j t  j |   } | j t j    } | | j   } t	 j
 |  } | j d  d } t |  } t | j |  } t |  d  S(   Ni   i    i   (   R   t   compressobjt   Z_BEST_COMPRESSIONt   DEFLATEDR
   t   compresst   VOTABLE_XMLt   encodet   flushR   t   BytesIOt   seekR   R   R   t   list(   t   zlib_GZIP_STYLE_HEADERt   compot   sR   t   MINIMUM_REQUESTABLE_BUFFER_SIZEt   uncompressed_fdt   iterable(    (    sE   lib/python2.7/site-packages/astropy/utils/xml/tests/test_iterparse.pyt    test_iterparser_over_read_simpleq   s    		(   t
   __future__R    R   R   R   t   utils.xml.iterparserR   t   externR   R   t   HEADERt   ROWt   FOOTERR#   t   objectR   R/   (    (    (    sE   lib/python2.7/site-packages/astropy/utils/xml/tests/test_iterparse.pyt   <module>   s   ")