ó
‹wÛjc           @   sÏ   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l m Z m Z m Z m Z e j	 d k rs e j
 d ƒ ‚ n  e d Z d e j e j f Z d e j f d „  ƒ  YZ d	 „  Z e d
 k rË e ƒ  n  d S(   iÿÿÿÿN(   t   TESTFNt   run_unittestt   unlinkt   reap_childrent   posixs    pipes module only works on posixt   2s   tr %s %st   SimplePipeTestsc           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%   x t  t f D] } t | ƒ q Wd  S(   N(   R    t   TESTFN2R   (   t   selft   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_pipes.pyt   tearDown   s    c         C   sw   t  j ƒ  } | j t t  j ƒ | j t d ƒ } | j d ƒ | j ƒ  t t ƒ � } |  j	 | j
 ƒ  d ƒ Wd  QXd  S(   Nt   ws   hello world #1s   HELLO WORLD #1(   t   pipest   Templatet   appendt	   s_commandt   STDIN_STDOUTt   openR    t   writet   closet   assertEqualt   read(   R   t   tR	   (    (    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_pipes.pyt   testSimplePipe1   s    
c         C   s‡   t  t d ƒ � } | j d ƒ Wd  QXt j ƒ  } | j t d t j ƒ | j t t	 ƒ t  t	 ƒ � } |  j
 | j ƒ  d ƒ Wd  QXd  S(   NR   s   hello world #2s    < $IN > $OUTs   HELLO WORLD #2(   R   R    R   R   R   R   R   t   FILEIN_FILEOUTt   copyR   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_pipes.pyt   testSimplePipe2   s    c         C   s}   t  t d ƒ � } | j d ƒ Wd  QXt j ƒ  } | j t d t j ƒ | j  t d ƒ � } |  j | j	 ƒ  d ƒ Wd  QXd  S(   NR   s   hello world #2s    < $INt   rs   HELLO WORLD #2(
   R   R    R   R   R   R   R   t   FILEIN_STDOUTR   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_pipes.pyt   testSimplePipe3&   s    c      	   C   s›   d } t  t d ƒ � } | j | ƒ Wd  QXt  t d ƒ � } | j d ƒ Wd  QXt j ƒ  } | j t t ƒ t  t ƒ � } |  j | j ƒ  | ƒ Wd  QXd  S(   Ns   empty pipeline test COPYR   t    (	   R   R    R   R   R   R   R   R   R   (   R   t   dR	   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_pipes.pyt   testEmptyPipeline1.   s    c         C   sl   d } t  t d ƒ � } | j | ƒ Wd  QXt j ƒ  } | j  t d ƒ � } |  j | j ƒ  | ƒ Wd  QXd  S(   Ns   empty pipeline test READR   R   (   R   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_pipes.pyt   testEmptyPipeline2:   s    c         C   si   d } t  j ƒ  } | j t d ƒ � } | j | ƒ Wd  QXt t ƒ � } |  j | j ƒ  | ƒ Wd  QXd  S(   Ns   empty pipeline test WRITER   (   R   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_pipes.pyt   testEmptyPipeline3C   s    c         C   sÍ   t  j t  j d } d } |  j t j d ƒ d ƒ |  j t j | ƒ | ƒ |  j t j d ƒ d ƒ x/ | D]' } |  j t j d | ƒ d | ƒ ql Wx/ | D]' } |  j t j d	 | ƒ d
 | ƒ qž Wd  S(   Ns
   @%_-+=:,./s   "`$\!R   s   ''s   test file names   'test file name's
   test%snames   'test%sname's   test%s'name's   'test%s'"'"'name'"'"''(   t   stringt   ascii_letterst   digitsR   R   t   quote(   R   t   safeunquotedt   unsafet   u(    (    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_pipes.pyt   testQuotingL   s    c         C   sO   t  j ƒ  } |  j t | ƒ d ƒ | j d t  j ƒ |  j t | ƒ d ƒ d  S(   Ns   <Template instance, steps=[]>s
   tr a-z A-Zs1   <Template instance, steps=[('tr a-z A-Z', '--')]>(   R   R   R   t   reprR   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_pipes.pyt   testReprZ   s
    c         C   sP   t  j ƒ  } | j t ƒ |  j | j t ƒ | j t ƒ |  j | j t ƒ d  S(   N(   R   R   t   debugt   FalseR   t	   debuggingt   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_pipes.pyt   testSetDebuga   s
    c         C   s<   t  j ƒ  } | j d t  j ƒ |  j t | j d d ƒ d  S(   Nt   boguscmdt	   bogusfileR   (   R   R   R   t   SINKt   assertRaisest
   ValueErrorR   (   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_pipes.pyt   testReadOpenSinkh   s    c         C   s<   t  j ƒ  } | j d t  j ƒ |  j t | j d d ƒ d  S(   NR2   R3   R   (   R   R   t   prependt   SOURCER5   R6   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_pipes.pyt   testWriteOpenSourceo   s    c         C   s<  t  j ƒ  } |  j t | j d t  j ƒ |  j t | j d d ƒ |  j t | j d t  j ƒ t  j ƒ  } | j d t  j ƒ |  j t | j d t  j ƒ t  j ƒ  } |  j t | j d t  j	 ƒ t  j ƒ  } |  j t | j d t  j
 ƒ t  j ƒ  } |  j t | j d t  j	 ƒ t  j ƒ  } |  j t | j d t  j ƒ d  S(   Ni   R2   t   xxs   boguscmd $OUTs   boguscmd $IN(   R   R   R5   t	   TypeErrorR   R   R6   R9   R4   R   R   t   STDIN_FILEOUT(   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_pipes.pyt   testBadAppendOptionsv   s&    


c         C   s<  t  j ƒ  } |  j t | j d t  j ƒ |  j t | j d d ƒ |  j t | j d t  j ƒ t  j ƒ  } | j d t  j ƒ |  j t | j d t  j ƒ t  j ƒ  } |  j t | j d t  j	 ƒ t  j ƒ  } |  j t | j d t  j
 ƒ t  j ƒ  } |  j t | j d t  j	 ƒ t  j ƒ  } |  j t | j d t  j ƒ d  S(   Ni   s
   tr a-z A-ZR;   R2   s   boguscmd $OUTs   boguscmd $IN(   R   R   R5   R<   R8   R   R6   R4   R9   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_pipes.pyt   testBadPrependOptions˜   s&    


c         C   s)   t  j ƒ  } |  j t | j d d ƒ d  S(   NR3   t   x(   R   R   R5   R6   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_pipes.pyt   testBadOpenMode¹   s    c         C   s™   t  j ƒ  } | j d t  j ƒ | j ƒ  } |  j t | ƒ t | ƒ ƒ |  j | j | j ƒ |  j t | j ƒ t | j ƒ ƒ |  j | j	 | j	 ƒ d  S(   Ns
   tr a-z A-Z(
   R   R   R   R   t   clonet   assertNotEqualt   idR   t   stepsR/   (   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_pipes.pyt	   testClone½   s    "(   t   __name__t
   __module__R
   R   R   R   R    R!   R"   R*   R,   R1   R7   R:   R>   R?   RA   RF   (    (    (    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_pipes.pyR      s    																	"	!	c           C   s   t  t ƒ t ƒ  d  S(   N(   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_pipes.pyt	   test_mainÇ   s    
t   __main__(   R   t   osR#   t   unittestt   test.test_supportR    R   R   R   t   namet   SkipTestR   t   ascii_lowercaset   ascii_uppercaseR   t   TestCaseR   RI   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_pipes.pyt   <module>   s   "
¸	