| Server IP : 118.27.122.248 / Your IP : 216.73.216.15 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/test/test_json/__pycache__/ |
Upload File : |
3
�w2_z � @ s^ d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ d dl m
Z
G dd� dej�ZdS )� N)�Popen�PIPE)�support)�assert_python_okc @ sT e Zd ZdZejd�Zejd�Zdd� Zdd� Z dd � Z
d
d� Zdd
� Zdd� Z
dS )�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 sf t jddf}t|tttd��}|j| jj� �\}}W d Q R X | j|j� | j j� j� � | j|d� d S )Nz-mz json.tool)�stdin�stdout�stderr� )
�sys�
executabler r Zcommunicate�data�encode�assertEqual�
splitlines�expect)�self�args�proc�out�err� r �=/opt/alt/python36/lib64/python3.6/test/test_json/test_tool.py�test_stdin_stdout? s
zTestTool.test_stdin_stdoutc
C s: t j}t|d�� }| jtj|� |j| j� W d Q R X |S )N�w)r �TESTFN�open�
addCleanup�os�remove�writer
)r �infile�fpr r r �_create_infileF s
zTestTool._create_infilec C sP | j � }tdd|�\}}}| j|d� | j|j� | jj� j� � | j|d� d S )Nz-mz json.toolr r
)r# r r r r r )r r! �rcr r r r r �test_infile_stdoutM s
zTestTool.test_infile_stdoutc
C s� | j � }tjd }tdd||�\}}}| jtj|� t|d��}| j|j � | j
� W d Q R X | j|d� | j|d� | j|d� d S )Nz.outz-mz json.tool�rr r
)r# r r r r r r r r �readr )r r! Zoutfiler$ r r r"