https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/simplejson/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/simplejson/tests/__pycache__/test_unicode.cpython-310.pyc
o

\Փa��@sPddlZddlZddlmZddlZddlmZmZm	Z	m
Z
Gdd�de�ZdS)�N)�TestCase)�unichr�	text_type�b�BytesIOc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)&�TestUnicodecCs>tjdd�}d}|�d�}|�|�}|�|�}|�||�dS)N�utf-8��encoding�αΩ)�json�JSONEncoder�encode�assertEqual)�self�encoder�u�s�ju�js�r�?/usr/lib/python3/dist-packages/simplejson/tests/test_unicode.py�test_encoding1	s


zTestUnicode.test_encoding1cCs:d}|�d�}tj|dd�}tj|dd�}|�||�dS)Nrrr	)rr�dumpsr)rrrrrrrr�test_encoding2s

zTestUnicode.test_encoding2cCsd}t�|�}|�|d�dS)Nrz"\u03b1\u03a9"�rrr�rr�jrrr�test_encoding3s
zTestUnicode.test_encoding3cCs d}t�|g�}|�|d�dS)Nrz["\u03b1\u03a9"]rrrrr�test_encoding4szTestUnicode.test_encoding4cCs*d}tj|dd�}|�|d|d�dS)NrF��ensure_ascii�"rrrrr�test_encoding5"szTestUnicode.test_encoding5cCs,d}tj|gdd�}|�|d|d�dS)NrFr z["z"]rrrrr�test_encoding6'szTestUnicode.test_encoding6cCs0d}|�t�|�d�|�tj|dd�d�dS)Nu𝄠z"\ud834\udd20"Fr u"𝄠")rrr�rrrrr�test_big_unicode_encode,sz#TestUnicode.test_big_unicode_encodecCs4d}|�t�d|d�|�|�t�d�|�dS)Nuz𝄠xr"z"z\ud834\udd20x")rr�loadsr%rrr�test_big_unicode_decode1sz#TestUnicode.test_big_unicode_decodecCs8tdd�D]}t|�}d|f}|�t�|�|�qdS)Nri��z"\u%04x")�rangerrrr')r�irrrrr�test_unicode_decode6s

�zTestUnicode.test_unicode_decodecCs�d}gd�}|�t�|�t|��|�tj|dd�d�|�tj|tjd�}|�|t�|��|�t|�tj�|�tj|tjdd�d�t�|��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>B�zATestUnicode.test_object_pairs_hook_with_unicode.<locals>.<lambda>)�object_pairs_hookcSsdSr:rr;rrrr=Ir>)r?�object_hook)rrr'�eval�OrderedDict�type)rr�p�odrrr�#test_object_pairs_hook_with_unicode=s
��z/TestUnicode.test_object_pairs_hook_with_unicodecCs |�t�d�d��ddi�dS)Nu{"a": "é"}r�a�é)rrr'r�rrrr�test_default_encodingMs�z!TestUnicode.test_default_encodingcCsJ|�tt�d��t�|�tt�d��t�|�tt�d�d�t�dS)Nz""z"a"z["a"]r)rrCrr'rrIrrr�test_unicode_preservationQsz%TestUnicode.test_unicode_preservationcCsl|�ttjgdd��t�|�ttjddd��t�|�ttjidd��t�|�ttjddd��t�dS)NFr r�)rrCrrrrIrrr�'test_ensure_ascii_false_returns_unicodeVsz3TestUnicode.test_ensure_ascii_false_returns_unicodecCspdtd�i}ddi}d}d}|�t�|�|�|�t�|�|�|�tj|dd�|�|�tj|dd�|�dS)N�quuxuArrêt sur imagesuArrêt sur imagesz!{"quux": "Arr\u00eat sur images"}u{"quux": "Arrêt sur images"}Fr )rrrr)r�doc1�doc2�	doc_ascii�doc_unicoderrr�+test_ensure_ascii_false_bytestring_encoding]sz7TestUnicode.test_ensure_ascii_false_bytestring_encodingcCsjd}|�d�}d}d}|�t�|�|�|�t�|�|�|�tj|dd�|�|�tj|dd�|�dS)Nu

�utf8z"\u2029\u2028"u"

"Fr )rrrr)r�s1�s2�expect�expect_non_asciirrr�$test_ensure_ascii_linebreak_encodinghs
z0TestUnicode.test_ensure_ascii_linebreak_encodingcCsD|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd	�tjd
kr�|�tjtjd�|�tjtjd�|�tjtjd
�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�|�tjtjd�dSdS)Nz"\uz"\u1z"\u12z"\u123z"\u1234z"\u123x"z"\u12x4"z"\u1x34"z"\ux234"i��z
"\ud800\u"z"\ud800\u0"z"\ud800\u00"z
"\ud800\u000"z"\ud800\u000x"z"\ud800\u00x0"z"\ud800\u0x00"z"\ud800\ux000")�assertRaisesr�JSONDecodeErrorr'�sys�
maxunicoderIrrr�test_invalid_escape_sequencesss&
�z)TestUnicode.test_invalid_escape_sequencescCsXtttdd��D]}|�tj|dd�t�|��qd}|�tj|dd�d|d�dS)Nr�Fr u☃r")�maprr)rrr)r�c�snowmanrrr�test_ensure_ascii_still_works�s�
�z)TestUnicode.test_ensure_ascii_still_workscCsXd}tjtt�|��}|�t�t|��|�||�d�fD]}|�t�	|�|�qdS)NuこんにちわrT)
�codecs�BOM_UTF8rrrr�loadr�decoder')r�content�json_doc�docrrr�test_strip_bom�s�zTestUnicode.test_strip_bomN)�__name__�
__module__�__qualname__rrrrr#r$r&r(r+rFrJrKrMrSrYr^rcrkrrrrrs&r)r\rd�unittestr�
simplejsonr�simplejson.compatrrrrrrrrr�<module>s

https://t.me/RX1948 - 2025