ó
ŠwÛjc           @   s)  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z d e  j f d „  ƒ  YZ	 d e	 f d „  ƒ  YZ
 d e	 f d „  ƒ  YZ d  d l Z e j j d	 ƒ rÄ e Z n  d
 e
 f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z e d k r%e ƒ  n  d S(   iÿÿÿÿN(   t   test_supportt   TestGenericStringIOc           B   s´   e  Z d  Z e Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z e j e j d d d ƒd „  ƒ Z e j e j d d ƒd „  ƒ Z RS(   s5   abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!c         C   s9   |  j  |  j d d ƒ |  _ |  j j |  j ƒ |  _ d  S(   Ns   
i   (   t   constructort   _linet   _linest   MODULEt   StringIOt   _fp(   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_StringIO.pyt   setUp   s    c         C   så   |  j  } |  j t |  j j ƒ | |  j j d ƒ |  j d  ƒ | |  j j d ƒ d ƒ | |  j j d ƒ d ƒ | |  j j ƒ  |  j d d ƒ | t |  j j	 d ƒ ƒ d ƒ |  j j d ƒ | |  j j d ƒ |  j d ƒ d  S(   Ni
   i    t    s   
i<   i   iÿÿÿÿ(
   t   assertEqualt   assertRaisest	   TypeErrorR   t   seekt   readR   t   readlinet   lent	   readlines(   R   t   eq(    (    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_StringIO.pyt
   test_reads   s    	 !c         C   sˆ   |  j  j ƒ  } |  j t | j ƒ | j |  j d  ƒ | j d ƒ | j |  j d d !ƒ | j |  j d ƒ |  j | j ƒ  d ƒ d  S(   Ni   i   i   i   i4   s
   abcuvwxyz!(	   R   R   R   R   R   t   writeR   R   t   getvalue(   R   t   f(    (    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_StringIO.pyt   test_writes%   s    c         C   sa   |  j  j ƒ  } | j |  j d |  j d |  j d g ƒ | j d ƒ |  j | j ƒ  d ƒ d  S(   Ni    i   i   t   abc(   R   R   t
   writelinesR   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_StringIO.pyt   test_writelines.   s    +c         C   s5   d „  } |  j  j ƒ  } |  j t | j | ƒ  ƒ d  S(   Nc           s   s   d Vt  ƒ  ‚ d  S(   Nt   a(   t   KeyboardInterrupt(    (    (    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_StringIO.pyt   errorGen5   s    (   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_StringIO.pyt   test_writelines_error4   s    	c         C   sÌ   |  j  } |  j j ƒ  } | j |  j ƒ | j d ƒ | j ƒ  | | j ƒ  d ƒ | j d ƒ | | j ƒ  d ƒ | j d ƒ | | j ƒ  d ƒ |  j t	 | j d ƒ | j
 ƒ  |  j t | j d ƒ d  S(	   Ni
   t
   abcdefghiji   t   abcdet   xyzt   abcdexyziÿÿÿÿt   frobnitz(   R   R   R   R   R   R   t   truncateR   R   t   IOErrort   closet
   ValueError(   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_StringIO.pyt   test_truncate;   s    	

c         C   s…   |  j  j ƒ  } |  j | j t ƒ | j ƒ  |  j | j t ƒ |  j  j d ƒ } |  j | j t ƒ | j ƒ  |  j | j t ƒ d  S(   NR   (   R   R   R   t   closedt   FalseR'   t   True(   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_StringIO.pyt   test_closed_flagJ   s    

c         C   s\   |  j  j ƒ  } |  j t | j d  ƒ |  j | j ƒ  t ƒ | j ƒ  |  j t	 | j ƒ d  S(   N(
   R   R   R   R   t   isattyt   NoneR   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_StringIO.pyt   test_isattyT   s
    
c         C   sÃ   |  j  } |  j } | t |  j ƒ |  j ƒ | t |  j d ƒ ƒ | t |  j d ƒ ƒ d } x/ |  j D]$ } | | |  j d ƒ | d 7} qg W| | d ƒ |  j j ƒ  |  j t |  j j	 ƒ d  S(   Nt   __iter__t   nexti    s   
i   i   (
   R   t
   assertTruet   iterR   t   hasattrR   R'   R   R(   R2   (   R   R   t   unlesst   it   line(    (    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_StringIO.pyt   test_iterator[   s    		c         C   s'   |  j  j ƒ  |  j t |  j  j ƒ d  S(   N(   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_StringIO.pyt   test_getvaluej   s    i   i   t   memuseg5^ºI @c         C   s²  d	 } d | d d g | | d | | g } |  j  j d j | ƒ ƒ } x[ t | ƒ D]M \ } } | j t | ƒ ƒ } |  j t | ƒ t | ƒ ƒ |  j | | ƒ qZ W|  j | j ƒ  d ƒ | j d ƒ xR t | ƒ D]D \ } } | j ƒ  } |  j t | ƒ t | ƒ ƒ |  j | | ƒ qÛ W|  j | j ƒ  d ƒ | j d ƒ |  j | j	 ƒ  | ƒ |  j | j	 ƒ  g  ƒ | j d ƒ |  j | j	 | ƒ | ƒ |  j | j	 ƒ  g  ƒ d  S(
   Ni   i   t   xi   s   
t   yR
   i    i   (
   R   R   t   joint	   enumerateR   R   R   R   R   R   (   R   t   sizet   linesizet   linesR   R7   t   expectedR8   (    (    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_StringIO.pyt   test_reads_from_large_streamn   s*    i   c         C   sŒ   d d } |  j  j ƒ  } | } x3 | t | ƒ k rT | j | ƒ | t | ƒ 8} q" Wd  } | j d | ƒ |  j t | j ƒ  ƒ | ƒ d  S(   NR<   i   i   i   (   R   R   R   R   R/   R   R   (   R   R@   t   sR   t   n(    (    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_StringIO.pyt   test_writes_to_large_streamˆ   s    
i   (   t   __name__t
   __module__R   t   strR   R	   R   R   R   R   R)   R-   R0   R9   R:   R    t
   bigmemtestt   _2GRD   RG   (    (    (    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_StringIO.pyR      s   								
			%t   TestStringIOc           B   s   e  Z e Z d  „  Z RS(   c         C   s³   t  j s d  S|  j j ƒ  } | j |  j d  ƒ | j d ƒ | j t |  j d d !ƒ ƒ | j t |  j d ƒ ƒ | j ƒ  } |  j	 | t d ƒ ƒ |  j	 t
 | ƒ t j ƒ d  S(   Ni   i   i   i   i4   s
   abcuvwxyz!(   R    t   have_unicodeR   R   R   R   R   t   unicodeR   R   t   typet   typest   UnicodeType(   R   R   RE   (    (    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_StringIO.pyt   test_unicode˜   s    	 (   RH   RI   R   R   RS   (    (    (    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_StringIO.pyRM   •   s   t   TestcStringIOc           B   s    e  Z e Z d  „  Z d „  Z RS(   c         C   sG   t  j  d d d d g ƒ } |  j j | ƒ } |  j | j ƒ  d ƒ d  S(   Nt   Bi    i   i   s    (   t   arrayR   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_StringIO.pyt   test_array_support¬   s    c         C   s¼   t  j s d  S|  j j ƒ  } | j d ƒ | j ƒ  } |  j | d ƒ |  j t | ƒ t ƒ |  j j d ƒ } | j ƒ  } |  j | d ƒ |  j t | ƒ t ƒ |  j	 t
 |  j j d ƒ d  S(   Nu   abcdeR!   u   Ã´(   R    RN   R   R   R   R   R   RP   RJ   R   t   UnicodeEncodeError(   R   R   RE   (    (    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_StringIO.pyRS   ²   s    	 (   RH   RI   t	   cStringIOR   RW   RS   (    (    (    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_StringIO.pyRT   ©   s   	t   javat   TestBufferStringIOc           B   s   e  Z e Z RS(    (   RH   RI   t   bufferR   (    (    (    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_StringIO.pyR[   Î   s   t   TestBuffercStringIOc           B   s   e  Z e Z RS(    (   RH   RI   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_StringIO.pyR]   Ñ   s   t   TestMemoryviewcStringIOc           B   s   e  Z e Z RS(    (   RH   RI   t
   memoryviewR   (    (    (    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_StringIO.pyR^   Ô   s   c           C   sM   t  j t t ƒ t  j d t f ƒ � t  j t t ƒ Wd  QXt  j t ƒ d  S(   Ns   buffer.. not supported(	   R    t   run_unittestRM   RT   t   check_py3k_warningst   DeprecationWarningR[   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_StringIO.pyt	   test_mainØ   s
    	t   __main__(   t   unittestR   RY   RQ   RV   t   syst   testR    t   TestCaseR   RM   RT   t   platformt
   startswithRJ   R\   R[   R]   R^   Rc   RH   (    (    (    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_StringIO.pyt   <module>   s$   ‰		