Your IP : 216.73.216.213
o
0�i] � @ sj d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z d dl
mZ G dd� dej�Z
dS )� N)�support)� os_helper)�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/python310/lib64/python3.10/test/test_json/test_tool.py�test_stdin_stdoutX s zTestTool.test_stdin_stdoutNc C sX t j}t|ddd��}| �tj|� |�|p| j� W d � |S 1 s%w 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( r r �
splitlinesr �encode�r r&