mς
­fIc           @   sI   d  Z  d k Z d k Z d k l Z d   Z d   Z e   e   d S(   s.   Test script for popen2.py
   Christian Tismer
N(   s   TestSkippedc          C   s   d GHt  i d  d j p t  i d  d j o! t d j o t d t  i  n y d k l } Wn  t j
 o d	 k l }  n Xd  k } | i	   d  S(
   Ns   Test popen2 module:i   t   beosi   t   atheost   __main__s'   popen2() doesn't work during import on (   s   popen(   s   fork(
   t   syst   platformt   __name__t   TestSkippedt   ost   popent   ImportErrort   forkt   popen2t   _test(   R
   R   R   (    (    t-   /mit/python/lib/python2.4/test/test_popen2.pyt   main   s    5	c    	      C   s¬  d GHd  k  } d } d } t i d j o
 d } n | i   } d GHt i  |  \ } } | i	 |  | i
   | i   } | i   | j o t d | | f   n d GHy t i | g  \ } } }  Wn t i |  \ } } }  n X| i	 |  | i
   | i   } | i   | j o t d | | f   n |  i   } | o t d	 | f   n x | i D] } | i   quW| i o t d
   n d GHd  S(   Ns   Testing os module:t   cats   ab cd
t   ntt   mores   testing popen2...s   wrote %r read %rs   testing popen3...s   unexpected %r on stderrs   _active not emptys   All OK(   R   t   cmdt   teststrR   t   namet   stript   expectedt   wt   rt   writet   closet   readt   gott
   ValueErrort   popen3t   et   _activet   instt   wait(	   R   R   R   R   R   R!   R   R   R   (    (    R   R   "   sB    	


 
(   t   __doc__R   R   t   test.test_supportR   R   R   (   R   R   R   R   R   (    (    R   t   ?   s   				&