ó
wÛjc           @  sĩ  d  d l  m Z d  d l  m 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 e e j d  s e j d   n  d d Z d
 d d d d d e g Z d j e  d Z d j e  d Z d j e  d Z d j e  d Z g  e D] Z e d ^ qZ d e j f d     YZ d e f d     YZ 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ĸĸĸĸ(   t   print_function(   t   unicode_literalsN(   t   test_supportu   newlinesu3   This Python does not have universal newline supportu   xi   i   u   line1=1u@   line2='this is a very long line designed to go past any default u;   buffer limits that exist in io.py but we also want to test u   the uncommon case, naturally.'u   def line3():passu   line4 = '%s'u   
u   u   
t   TestGenericUnivNewlinesc           B  sJ   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   u   ru   wbc         C  s\   |  j  } d |  j k r* | j d  } n  |  j t j |  j   } | j |  Wd  QXd  S(   Nu   bu   ascii(   t   DATAt	   WRITEMODEt   encodet   opent   supportt   TESTFNt   write(   t   selft   datat   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_univnewlines.pyt   setUp.   s
    	c         C  s"   y t  j t j  Wn n Xd  S(   N(   t   ost   unlinkR   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_univnewlines.pyt   tearDown5   s    c         C  sc   |  j  t j |  j   } | j   } Wd  QX|  j | t  |  j t | j  t |  j	   d  S(   N(
   R   R   R	   t   READMODEt   readt   assertEqualt   DATA_LFt   sett   newlinest   NEWLINE(   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_univnewlines.pyt	   test_read;   s    c         C  sc   |  j  t j |  j   } | j   } Wd  QX|  j | t  |  j t | j  t |  j	   d  S(   N(
   R   R   R	   R   t	   readlinesR   t
   DATA_SPLITR   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_univnewlines.pyt   test_readlinesA   s    c         C  s   |  j  t j |  j  ? } g  } | j   } x# | rR | j |  | j   } q0 WWd  QX|  j | t  |  j t | j	  t |  j
   d  S(   N(   R   R   R	   R   t   readlinet   appendR   R   R   R   R   (   R   R   R   t   d(    (    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_univnewlines.pyt   test_readlineG   s    	c         C  s   |  j  t j |  j  V } | j   | j   } | j   } |  j | t d  | j	 |  | j   } Wd  QX|  j | t d  d  S(   Ni   (
   R   R   R	   R   R   t   tellR   R   R   t   seek(   R   R   t   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_univnewlines.pyt	   test_seekQ   s    
(
   t   __name__t
   __module__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_univnewlines.pyR   (   s   					
t   TestCRNewlinesc           B  s   e  Z d  Z e Z RS(   u   (   R%   R&   R   t   DATA_CRR   (    (    (    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_univnewlines.pyR'   \   s   t   TestLFNewlinesc           B  s   e  Z d  Z e Z RS(   u   
(   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_univnewlines.pyR)   `   s   t   TestCRLFNewlinesc           B  s   e  Z d  Z e Z d   Z RS(   u   
c         C  s~   |  j  t j |  j  > } |  j t | j  t d    | j   } | j	   } Wd  QX|  j t | j  t |  j
   d  S(   N(   R   R   R	   R   R   t   reprR   t   NoneR   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_univnewlines.pyt	   test_tellh   s
    (   R%   R&   R   t	   DATA_CRLFR   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_univnewlines.pyR*   d   s   t   TestMixedNewlinesc           B  s   e  Z d Z e Z RS(   u   u   
(   u   u   
(   R%   R&   R   t
   DATA_MIXEDR   (    (    (    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_univnewlines.pyR/   o   s   c          C  sŽ   t  t t t f }  g  } x |  D]x } d | f d     Y} t d | j  | _ d | f d     Y} t d | j  | _ | j |  | j |  q Wt j |   d  S(   Nt   CTestc           B  s   e  Z e j Z RS(    (   R%   R&   t   ioR   (    (    (    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_univnewlines.pyR1   |   s   u   Ct   PyTestc           B  s   e  Z e e j  Z RS(    (   R%   R&   t   staticmethodt   pyioR   (    (    (    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_univnewlines.pyR3      s   u   Py(	   R'   R)   R*   R/   t   strR%   R   R   t   run_unittest(   t
   base_testst   testst   testR1   R3   (    (    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_univnewlines.pyt	   test_maint   s    	u   __main__i @  (    t
   __future__R    R   R2   t   _pyioR5   t   unittestR   t   sysR:   R   R   t   hasattrt   stdint   SkipTestt   FATXt   DATA_TEMPLATEt   joinR   R(   R.   R0   t   xR   t   TestCaseR   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_univnewlines.pyt   <module>   s:   
4	