Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_json/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_json/__pycache__/test_recursion.cpython-312.opt-2.pyc

�

)Μg
��x�ddlmZddlmZmZGd�d�ZGd�d�ZGd�dee�ZGd	�d
ee�Zy)�)�support)�PyTest�CTestc��eZdZy)�JSONTestObjectN��__name__�
__module__�__qualname__���:/usr/local/lib/python3.12/test/test_json/test_recursion.pyrrs��r
rc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�
TestRecursionc�L�g}|j|�	|j|�|jd�g}|g}|j|�	|j|�|jd�g}||g}|j|�y#t$rY�\wxYw#t$rY�2wxYw)Nz)didn't raise ValueError on list recursionz5didn't raise ValueError on alternating list recursion)�append�dumps�fail�
ValueError��self�x�ys   r�test_listrecursionz TestRecursion.test_listrecursion
s�����	�����	C��J�J�q�M�
�I�I�A�B���
�C��	�����	O��J�J�q�M�
�I�I�M�N���
��F���
�
�1�
��!�	��	���	��	�s#�B�B�	B�B�	B#�"B#c��i}||d<	|j|�|jd�i}||d�}|j|�y#t$rY�$wxYw)N�testz)didn't raise ValueError on dict recursion)�a�b)rrrrs   r�test_dictrecursionz TestRecursion.test_dictrecursion!s^������&�	�	C��J�J�q�M�
�I�I�A�B����!����
�
�1�
���	��	�s�A�	A�Ac��Gd�d|jj�}|�}|j|jt�d�d|_	|jt�|j
d�y#t$rYywxYw)Nc��eZdZdZd�Zy)�ATestRecursion.test_defaultrecursion.<locals>.RecursiveJSONEncoderFc��|tur|jrtgSy|jjj	|�S)Nr)r�recurse�json�JSONEncoder�default�r�os  rr'zITestRecursion.test_defaultrecursion.<locals>.RecursiveJSONEncoder.default2s8����&��|�|� .�/�/�/��y�y�,�,�4�4�Q�7�7r
N)r	r
rr$r'rr
r�RecursiveJSONEncoderr"0s���G�
8r
r*z"JSONTestObject"Tz,didn't raise ValueError on default recursion)r%r&�assertEqual�encoderr$rr)rr*�encs   r�test_defaultrecursionz#TestRecursion.test_defaultrecursion/sx��	8�4�9�9�#8�#8�	8�#�$��������N�3�5G�H����	F��J�J�~�&�
�I�I�D�E���	��	�s�A;�;	B�Bc��|jt�5tj�5|j	ddzdzddzz�ddd�ddd�|jt�5tj�5|j	ddzdzddzz�ddd�ddd�|jt�5tj�5|j	ddzdzddzz�ddd�ddd�y#1swY��xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swY�BxYw#1swYyxYw)Nz{"a":順�1�}z[1]�[�])�assertRaises�RecursionErrorr�infinite_recursion�loads)rs r�#test_highly_nested_objects_decodingz1TestRecursion.test_highly_nested_objects_decodingEs	���
�
�~�
.��+�+�-��
�
�7�V�+�c�1�C�&�L�@�A�.�/��
�
�~�
.��+�+�-��
�
�7�V�+�e�3�c�F�l�B�C�.�/��
�
�~�
.��+�+�-��
�
�3��<�#�-��f��<�=�.�/�
.�.�-��/�
.��.�-��/�
.��.�-��/�
.�sj�D�D
�	D�.D.�D"�!D.�E�D:�9E�
D	�D�D�"D+	�'D.�.D7�:E	�?E�Ec���gi}}td�D]	}|gd|i}}�|jt�5tj�5|j|�ddd�ddd�|jt�5tj�5|j|�ddd�ddd�y#1swY�^xYw#1swY�bxYw#1swY�*xYw#1swYyxYw)Nr0�k)�ranger5r6rr7r)r�l�drs    r�#test_highly_nested_objects_encodingz1TestRecursion.test_highly_nested_objects_encodingRs����2�1���v��A��3��Q��q�A��
�
�
�~�
.��+�+�-��
�
�1�
�.�/��
�
�~�
.��+�+�-��
�
�1�
�.�/�
.�.�-��/�
.��.�-��/�
.�sG�C�B5�C�=C�C
�$C�5B>	�:C�C
�
C	�C�C"c��Gd�d|jj�}|jt�5t	j
�5|d��j
d�ddd�ddd�y#1swY�xYw#1swYyxYw)Nc��eZdZd�Zy)�@TestRecursion.test_endless_recursion.<locals>.EndlessJSONEncoderc�
�	|gS)Nrr(s  rr'zHTestRecursion.test_endless_recursion.<locals>.EndlessJSONEncoder.defaultas��U��s�
r
N)r	r
rr'rr
r�EndlessJSONEncoderrB`s��
r
rDF)�check_circulary@)r%r&r5r6rr7r,)rrDs  r�test_endless_recursionz$TestRecursion.test_endless_recursion^sd��	����!6�!6�	�
�
�
�~�
.��+�+�-�"�%�8�?�?��C�.�/�
.�-�-��/�
.�s#�B�
A4�#B�4A=	�9B�B	N)	r	r
rrrr.r9r?rFrr
rrr	s"���.�F�,>�
�	Dr
rc��eZdZy)�TestPyRecursionNrrr
rrHrHj��r
rHc��eZdZy)�TestCRecursionNrrr
rrKrKkrIr
rKN)	rr�test.test_jsonrrrrrHrKrr
r�<module>rMs:���(�	�	�^D�^D�B3�m�V�2�0�]�E�0r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists