Your IP : 216.73.216.213
�
g f� � @ 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 Gd d � d e j � Z
d S)� N)�support)�assert_python_okc @ sU e Z d Z d Z e j d � Z d d � Z d d � Z d d � Z d d
� Z
d S)�TestToolz�
[["blorpie"],[ "whoops" ] , [
], "d-shtaeou",
"d-nthiouh",
"i-vhbjkhnth", {"nifty":87}, {"morefield" : false,"field"
:"yes"} ]
a. [
[
"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 � � \ } } Wd QX| j | j � | j
j � j � � | j | d � d S)Nz-mz json.tool�stdin�stdout)�
subprocess�Popen�sys�
executable�PIPEZcommunicate�data�encode�assertEqual�
splitlines�expect)�self�proc�out�err� r �=/opt/alt/python34/lib64/python3.4/test/test_json/test_tool.py�test_stdin_stdout( s $%zTestTool.test_stdin_stdoutc
C sH t j } t | d � �* } | j t j | � | j | j � Wd QX| S)N�w)r �TESTFN�open�
addCleanup�os�remove�writer )r �infile�fpr r r �_create_infile0 s
zTestTool._create_infilec C s` | j � } t d d | � \ } } } | j | j � | j j � j � � | j | d � d S)Nz-mz json.tool� )r! r r r r r
)r r �rcr r r r r �test_infile_stdout7 s %zTestTool.test_infile_stdoutc
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)Nz.outz-mz json.tool�rr"