ó
Ú6e]c           @` s\  d  d l  m Z m Z 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
 d g d g d g d g d g d	 g d d
 g d d
 g d d
 g d d
 g d	 d
 g d d g d	 d g d d g d	 d g g Z e j d e
 j e
 j g ƒ d „  ƒ Z e j d „  ƒ Z e j j d e ƒ d „  ƒ Z e j j d e ƒ d „  ƒ Z d S(   i    (   t   divisiont   absolute_importt   print_functionN(   t   _shell_utilst   exes   path/exes   path\exes   \\server\path\exes   path to/exes   path to\exes   --flags   --flag-"quoted"s   "--flag-quoted"t   paramsc         C` s   |  j  S(   N(   t   param(   t   request(    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyt   Parser!   s    c         C` sU   |  t  j k r t j d ƒ n  |  t  j k r5 d „  S|  t  j k rK d „  St ‚ d  S(   Ns$   Unable to run with non-native parserc         S` s   t  j |  ƒ S(   N(   t
   subprocesst   check_output(   t   cmd(    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyt   <lambda>/   t    c         S` s   t  j |  d t ƒS(   Nt   shell(   R	   R
   t   True(   R   (    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyR   2   R   (   R   t   NativeParsert   pytestt   skipt   WindowsParsert   PosixParsert   NotImplementedError(   R   (    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyt   runner)   s    t   argvc         C` sV   t  j d d g } |  j | | ƒ } | | ƒ j ƒ  } t j | ƒ | k sR t ‚ d S(   sB   
    Test that join produces strings understood by subprocess
    s   -cs1   import json, sys; print(json.dumps(sys.argv[1:]))N(   t   syst
   executablet   joint   decodet   jsont   loadst   AssertionError(   R   R   R   R   t   joinedt   json_out(    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyt   test_join_matches_subprocess7   s
    		c         C` sS   y. |  j  | ƒ } | |  j | ƒ k s- t ‚ Wn t k
 rN t j d ƒ n Xd S(   s:   
    Test that split is the inverse operation of join
    s   Not implementedN(   R   t   splitR   R   R   R   (   R   R   R   (    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyt   test_roundtripF   s
    (   t
   __future__R    R   R   R   R	   t   osR   R   t   numpy.distutilsR   t
   argv_casest   fixtureR   R   R   R   t   markt   parametrizeR!   R#   (    (    (    sE   lib/python2.7/site-packages/numpy/distutils/tests/test_shell_utils.pyt   <module>   s6   									