ó
ŠwÛjc           @   sÇ   d  Z  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 d d e
 ƒZ e j d k r‹ e j d ƒ ‚ n  d e j f d	 „  ƒ  YZ d
 „  Z e d k rÃ e ƒ  n  d S(   s0   
   Tests for commands module
   Nick Mathewson
iÿÿÿÿN(   t   run_unittestt   reap_childrent   import_modulet   check_warningst   commandst
   deprecatedt   posixs!   Not posix; skipping test_commandst   CommandTestsc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sª   |  j  t j d ƒ d ƒ |  j  t j d ƒ d ƒ d  } zN t j ƒ  } t j j	 | d ƒ } t j d | ƒ \ } } |  j
 | d ƒ Wd  | d  k	 r¥ t j | ƒ n  Xd  S(   Ns
   echo xyzzyt   xyzzyi    t   foos   cat (   i    R   (   t   assertEqualR   t	   getoutputt   getstatusoutputt   Nonet   tempfilet   mkdtempt   ost   patht   joint   assertNotEqualt   rmdir(   t   selft   dirt   namet   statust   output(    (    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_commands.pyt   test_getoutput   s    c      	   C   sK   d } t  d t f ƒ �- |  j t j | t j d ƒ t j ƒ ƒ Wd  QXd  S(   Ns7  d.........   # It is a directory.
                  [.+@]?       # It may have special attributes.
                  \s+\d+       # It has some number of links.
                  [^/]*        # Skip user, group, size, and date.
                  /\.          # and end with the name of the file.
               s$   .*commands.getstatus.. is deprecateds   /.(   R   t   DeprecationWarningt
   assertTruet   ret   matchR   t	   getstatust   VERBOSE(   R   t   pat(    (    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_commands.pyt   test_getstatus,   s    (   t   __name__t
   __module__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_commands.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_commands.pyt	   test_mainD   s    
t   __main__(   t   __doc__t   unittestR   R   R   t   test.test_supportR    R   R   R   t   TrueR   R   t   SkipTestt   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_commands.pyt   <module>   s   $",	