ó
wŰjc           @   s   d  Z  d d l Z d d l m Z d d l Z d d l Z e j Z d e j f d     YZ	 d   Z
 e d k r{ e
   n  d S(   sQ   Basic tests for os.popen()

  Particularly useful for platforms that fake popen.
i˙˙˙˙N(   t   test_supportt	   PopenTestc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   sM   d t  | f } t j |  j   d } t |  d } |  j | |  d  S(   Ns$   %s -c "import sys;print sys.argv" %ss   
i   (   t   pythont   ost   popent   readt   evalt   assertEqual(   t   selft   cmdlinet   expectedt   cmdt   datat   got(    (    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_popen.pyt   _do_test_commandline   s    c         C   si   |  j  t t j  |  j d d d g  |  j d d d d g  |  j d d d d g  t j   d  S(	   Ns   foo bart   foot   bars    foo "spam and eggs" "silly walk"s   spam and eggss
   silly walks   foo "a \"quoted\" arg" bars   a "quoted" arg(   t   assertRaisest	   TypeErrorR   R   R   R    t   reap_children(   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_popen.pyt
   test_popen   s    c         C   ss   |  j  t j d  j   d   t j d k rP |  j  t j d  j   d  n |  j  t j d  j   d  d  S(   Ns   exit 0t   nts   exit 42i*   i   i *  (   R   R   R   t   closet   Nonet   name(   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_popen.pyt   test_return_code(   s    "(   t   __name__t
   __module__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_popen.pyR      s   		c           C   s   t  j t  d  S(   N(   R    t   run_unittestR   (    (    (    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_popen.pyt	   test_main/   s    t   __main__(   t   __doc__t   unittestt   testR    R   t   syst
   executableR   t   TestCaseR   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_popen.pyt   <module>   s   		