HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/test_json/__pycache__/test_tool.cpython-37.pyc
B

��g6�@sfddlZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZGdd�dej�Z
dS)�N)�Popen�PIPE)�support)�assert_python_okc@sxeZdZdZe�d�Ze�d�Zdd�Zddd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Ze�ejdkd�dd��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"
        }
    ]
    c	Csftjddf}t|tttd��}|�|j���\}}WdQRX|�|��|j	�����|�|d�dS)Nz-mz	json.tool)�stdin�stdout�stderr�)
�sys�
executablerr�communicate�data�encode�assertEqual�
splitlines�expect)�self�args�proc�out�err�r�4/usr/local/lib/python3.7/test/test_json/test_tool.py�test_stdin_stdoutAs
zTestTool.test_stdin_stdoutNc	CsBtj}t|ddd��$}|�tj|�|�|p0|j�WdQRX|S)N�wzutf-8)�encoding)r�TESTFN�open�
addCleanup�os�remove�writer)rr�infile�fprrr�_create_infileHs
zTestTool._create_infilecCsP|��}tdd|�\}}}|�|d�|�|��|j�����|�|d�dS)Nz-mz	json.toolrr
)r%rrrrr)rr#�rcrrrrr�test_infile_stdoutOs
zTestTool.test_infile_stdoutcCs^d}t�d���}|�|�}tdd|�\}}}|�|d�|�|��|���|�|d�dS)Nu{"msg": "こんにちは"}zP        {
            "msg": "\u3053\u3093\u306b\u3061\u306f"
        }
        z-mz	json.toolrr
)�textwrap�dedentrr%rrr)rrrr#r&rrrrr�test_non_ascii_infileVs

zTestTool.test_non_ascii_infilec	Cs�|��}tjd}tdd||�\}}}|�tj|�t|d��}|�|�	�|j
�WdQRX|�|d�|�|d�|�|d�dS)Nz.outz-mz	json.tool�rrr
)r%rrrrr r!rr�readr)rr#Zoutfiler&rrr$rrr�test_infile_outfilees
zTestTool.test_infile_outfilecCs>tddd�\}}}|�|d�|�|�d��|�|d�dS)Nz-mz	json.toolz-hrsusage: r
)rrZ
assertTrue�
startswith)rr&rrrrr�test_help_flagpszTestTool.test_help_flagcCsR|��}tddd|�\}}}|�|d�|�|��|j�����|�|d�dS)Nz-mz	json.toolz--sort-keysrr
)r%rrr�expect_without_sort_keysr)rr#r&rrrrr�test_sort_keys_flagvs
zTestTool.test_sort_keys_flag�win32z-The test is failed with ValueError on WindowscCsBtjddg}t|ttd�}|j��|�d�|�|jt	j
�dS)Nz-mz	json.tool)rrs"{}")rrrrr�closer
r�
returncode�errnoZEPIPE)r�cmdrrrr�test_broken_pipe_error~s


zTestTool.test_broken_pipe_error)N)�__name__�
__module__�__qualname__rr(r)r0rrr%r'r*r-r/r1�unittestZskipIfr�platformr7rrrrrs
r)r5r rr(r;�
subprocessrrZtestrZtest.support.script_helperrZTestCaserrrrr�<module>s