Your IP : 216.73.216.213
a
XC?h � @ s^ d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z G dd� dej
�ZdS )� N)�support)�assert_python_okc @ s� e Zd ZdZe�d�Ze�d�Ze�d�Ze�d�Z dd� Z
d)d d
�Zdd� Zd
d� Z
dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Ze�ejd%kd&�d'd(� �ZdS )*�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"
}
]
zr {"ingredients":["frog", "water", "chocolate", "glucose"]}
{"ingredients":["chocolate","steel bolts"]}
z� {
"ingredients": [
"frog",
"water",
"chocolate",
"glucose"
]
}
{
"ingredients": [
"chocolate",
"steel bolts"
]
}
c C sD t jddf}tj|| jdddd�}| �|j| j� | �|jd� d S )N�-m� json.toolT��inputZcapture_output�textZcheck� ) �sys�
executable�
subprocess�run�data�assertEqual�stdout�expect�stderr��self�args�process� r �=/opt/alt/python39/lib64/python3.9/test/test_json/test_tool.py�test_stdin_stdoutW s zTestTool.test_stdin_stdoutNc C sV t j}t|ddd��.}| �tj|� |�|p0| j� W d � n1 sH0 Y |S )N�w�utf-8��encoding)r �TESTFN�open�
addCleanup�os�remove�writer )r r �infile�fpr r r �_create_infile] s
.zTestTool._create_infilec C sP | � � }tdd|�\}}}| �|d� | �|�� | j�� �� � | �|d� d S )Nr r r � )r'