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.10/test/test_json/__pycache__/test_dump.cpython-310.pyc
o

�ii	�@sbddlmZddlmZmZddlmZmZGdd�d�ZGdd�dee�Z	Gdd	�d	ee�Z
d
S)�)�StringIO)�PyTest�CTest)�
bigmemtest�_1Gc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestDumpcCs(t�}|j�i|�|�|��d�dS�Nz{})r�json�dump�assertEqual�getvalue)�self�sio�r�5/usr/local/lib/python3.10/test/test_json/test_dump.py�	test_dumpszTestDump.test_dumpcCs|�|�i�d�dSr�r�dumps�r
rrr�
test_dumpsszTestDump.test_dumpscCsxddd�}|�t��|j�|�Wd�n1swY|jj|dd�}|j�|�}|�d|�|�d|�dS)NFT)�invalid_key�	valid_key)Zskipkeysrr)ZassertRaises�	TypeErrorr	r�loadsZassertInZassertNotIn)r
�v�s�orrr�test_dump_skipkeyss
�zTestDump.test_dump_skipkeyscCs@|�|jddd�dd�d�|�|jddddd	�dd�d
�dS)NFT)TF�Z	sort_keysz{"false": true, "true": false}g@��)�g@F�z+{"false": 1, "2": 3.0, "4.0": 5, "6": true}rrrrr�test_encode_truefalses
����zTestDump.test_encode_truefalsecs2t�gd��fdd�}|�|j�|d�d�dS)N�
cs
�d=dS)N���r)�obj��arr�crasher$s
z-TestDump.test_encode_mutated.<locals>.crasher)�defaultz[null, null, null, null, null])�objectrr)r
r)rr'r�test_encode_mutated"s
�zTestDump.test_encode_mutatedcsdG�fdd�dt�}G�fdd�d���fdd�td�D��|�}d|d	<|�|j|d
d�d�dS)
NcseZdZ�fdd�ZdS)z)TestDump.test_encode_evil_dict.<locals>.Dcs�S)Nrr��Lrr�keys,�z.TestDump.test_encode_evil_dict.<locals>.D.keysN)�__name__�
__module__�__qualname__r/rr-rr�D+sr4cs eZdZ�fdd�Zdd�ZdS)z)TestDump.test_encode_evil_dict.<locals>.Xcs
�d=dS)Nr�9rrr-rr�__hash__0sz2TestDump.test_encode_evil_dict.<locals>.X.__hash__cSsdS)Nrr)r
rrrr�__lt__4r0z0TestDump.test_encode_evil_dict.<locals>.X.__lt__N)r1r2r3r6r7rr-rr�X/sr8csg|]}���qSrr)�.0�i)r8rr�
<listcomp>7sz2TestDump.test_encode_evil_dict.<locals>.<listcomp>ibztrue.datr5Trz{"1337": "true.dat"})�dict�rangerr)r
r4�dr)r.r8r�test_encode_evil_dict*szTestDump.test_encode_evil_dictN)	r1r2r3rrrr#r,r?rrrrrs
	rc@seZdZdS)�
TestPyDumpN)r1r2r3rrrrr@=sr@c@s eZdZeedd�dd��ZdS)�	TestCDumpr )�sizeZmemusecCs�td|t�}dg|}|�|�}|�t|�|d�|�|dd�d�|�|dd�d�|�|dd�d|d�dS)Ni�r ��[���z1]z1, )�intrrr�len)r
rB�N�l�encodedrrr�test_large_listFs

 zTestCDump.test_large_listN)r1r2r3rrrKrrrrrA?s
rAN)�iorZtest.test_jsonrrZtest.supportrrrr@rArrrr�<module>s7