Your IP : 216.73.216.213
��Yf� � @ 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 @ s| e Z d Z d Z e j d � Z e j d � Z d d � Z d 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
}
]
a. [
[
"blorpie"
],
[
"whoops"
],
[],
"d-shtaeou",
"d-nthiouh",
"i-vhbjkhnth",
{
"nifty": 87
},
{
"morefield": false,
"field": "yes"
}
]
c
C s� t j t j d d f d t j d t j ��% } | j | j j � � \ } } Wd QRX| 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/python35/lib64/python3.5/test/test_json/test_tool.py�test_stdin_stdout? s %%zTestTool.test_stdin_stdoutc
C sI t j } t | d � �* } | j t j | � | j | j � Wd QRX| S)N�w)r �TESTFN�open�
addCleanup�os�remove�writer )r �infile�fpr r r �_create_infileG s
zTestTool._create_infilec C sp | j � } t d d | � \ } } } | j | d � | j | j � | j j � j � � | j | d � d S)Nz-mz json.toolr � )r! r r r r r
)r r �rcr r r r r �test_infile_stdoutN s
%zTestTool.test_infile_stdoutc
C s� | j � } t j d } t d d | | � \ } } } | j t j | � t | d � � } | j | j � | j
� Wd QRX| j | d � | j | d � | j | d � d S)Nz.outz-mz json.tool�rr r"