HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/test/test_json/__pycache__/test_dump.cpython-38.pyc
U

0D�gi	�@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�7/opt/cppython/lib/python3.8/test/test_json/test_dump.py�	test_dumpszTestDump.test_dumpcCs|�|�i�d�dSr�r�dumps�r
rrr�
test_dumpsszTestDump.test_dumpsc	Csdddd�}|�t��|j�|�W5QRX|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$sz-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,sz.TestDump.test_encode_evil_dict.<locals>.D.keysN)�__name__�
__module__�__qualname__r/rr-rr�D+sr3cs 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__4sz0TestDump.test_encode_evil_dict.<locals>.X.__lt__N)r0r1r2r5r6rr-rr�X/sr7csg|]
}���qSrr)�.0�i)r7rr�
<listcomp>7sz2TestDump.test_encode_evil_dict.<locals>.<listcomp>ibztrue.datr4Trz{"1337": "true.dat"})�dict�rangerr)r
r3�dr)r.r7r�test_encode_evil_dict*szTestDump.test_encode_evil_dictN)	r0r1r2rrrr#r,r>rrrrrs
	rc@seZdZdS)�
TestPyDumpN)r0r1r2rrrrr?=sr?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
rA�N�l�encodedrrr�test_large_listFs

zTestCDump.test_large_listN)r0r1r2rrrJrrrrr@?s
r@N)�iorZtest.test_jsonrrZtest.supportrrrr?r@rrrr�<module>s
7