ó
]c           @   sy   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  d l m Z d e j	 f d     YZ
 d S(   iĸĸĸĸN(   t   test_support(   t   assert_python_okt   TestToolc           B   sA   e  Z d  Z e j d  Z d   Z d   Z d   Z d   Z	 RS(   sĘ   

        [["blorpie"],[ "whoops" ] , [
                                 ],	"d-shtaeou","d-nthiouh",
        "i-vhbjkhnth", {"nifty":87}, {"morefield" :	false,"field"
            :"yes"}  ]
           s.      [
        [
            "blorpie"
        ],
        [
            "whoops"
        ],
        [],
        "d-shtaeou",
        "d-nthiouh",
        "i-vhbjkhnth",
        {
            "nifty": 87
        },
        {
            "field": "yes",
            "morefield": false
        }
    ]
    c         C   s   t  j t j d d f d t  j d t  j } | j |  j j    \ } } |  j | j	   |  j
 j   j	    |  j | d   d  S(   Ns   -ms	   json.toolt   stdint   stdout(   t
   subprocesst   Popent   syst
   executablet   PIPEt   communicatet   datat   encodet   assertEqualt
   splitlinest   expectt   None(   t   selft   proct   outt   err(    (    s%   lib/python2.7/json/tests/test_tool.pyt   test_stdin_stdout(   s    %c         C   sH   t  j } t | d  * } |  j t j |  | j |  j  Wd  QX| S(   Nt   w(   R    t   TESTFNt   opent
   addCleanupt   ost   removet   writeR   (   R   t   infilet   fp(    (    s%   lib/python2.7/json/tests/test_tool.pyt   _create_infile0   s
    	c         C   s`   |  j    } t d d |  \ } } } |  j | j   |  j j   j    |  j | d  d  S(   Ns   -ms	   json.toolt    (   R   R   R   R   R   R   (   R   R   t   rcR   R   (    (    s%   lib/python2.7/json/tests/test_tool.pyt   test_infile_stdout7   s    %c         C   s   |  j    } t j d } t d d | |  \ } } } |  j t j |  t | d    } |  j | j	   |  j
  Wd  QX|  j | d  |  j | d  d  S(   Ns   .outs   -ms	   json.toolt   rR    (   R   R    R   R   R   R   R   R   R   t   readR   (   R   R   t   outfileR!   R   R   R   (    (    s%   lib/python2.7/json/tests/test_tool.pyt   test_infile_outfile=   s    (
   t   __name__t
   __module__R   t   textwrapt   dedentR   R   R   R"   R&   (    (    (    s%   lib/python2.7/json/tests/test_tool.pyR   	   s   				(   R   R   R)   t   unittestR   t   testR    t   test.script_helperR   t   TestCaseR   (    (    (    s%   lib/python2.7/json/tests/test_tool.pyt   <module>   s   