
    DUf
                         d dl Z d dlZ G d de          Z G d de          Z G d de          Z G d d	e          Z G d
 de	          Z
 G d de j                  ZdS )    Nc                       e Zd Zd ZdS )ForJsonc                 
    ddiS )Nfor_json    selfs    [/var/www/html/software/conda/lib/python3.11/site-packages/simplejson/tests/test_for_json.pyr   zForJson.for_json   s    A    N__name__
__module____qualname__r   r   r   r   r   r      s#            r   r   c                       e Zd Zd ZdS )NestedForJsonc                 "    dt                      iS Nnested)r   r	   s    r   r   zNestedForJson.for_json   s    '))$$r   Nr   r   r   r   r   r   
   s#        % % % % %r   r   c                       e Zd Zd ZdS )ForJsonListc                     dgS Nlistr   r	   s    r   r   zForJsonList.for_json   	    xr   Nr   r   r   r   r   r      #            r   r   c                       e Zd Zd ZdS )DictForJsonc                 
    ddiS )Nalphar   r   r	   s    r   r   zDictForJson.for_json   s    |r   Nr   r   r   r   r   r      s#            r   r   c                       e Zd Zd ZdS )ListForJsonc                     dgS r   r   r	   s    r   r   zListForJson.for_json   r   r   Nr   r   r   r   r"   r"      r   r   r"   c                   X    e Zd ZddZd Zd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd ZdS )TestForJsonTc                     |t          j        |          }nt          j        ||          }|                     t          j        |          |           d S )Nr   )jsondumpsassertEqualloads)r
   objotherr   ss        r   assertRoundTripzTestForJson.assertRoundTrip   s[    
3AA
3222AJqMM	 	 	 	 	r   c                     |                      t                      t                                                                 d S Nr/   r   r   r	   s    r   (test_for_json_encodes_stand_alone_objectz4TestForJson.test_for_json_encodes_stand_alone_object)   s>    IIII  	" 	" 	" 	" 	"r   c                     |                      dt                      idt                                                      i           d S )Nhoorayr2   r	   s    r   +test_for_json_encodes_object_nested_in_dictz7TestForJson.test_for_json_encodes_object_nested_in_dict.   sH    wyy!wyy))++,	. 	. 	. 	. 	.r   c                     |                      ddt                      ddgiddt                                                      ddgi           d S )Nr   r         r2   r	   s    r   7test_for_json_encodes_object_nested_in_list_within_dictzCTestForJson.test_for_json_encodes_object_nested_in_list_within_dict3   sZ    aAq)*a++--q!45	7 	7 	7 	7 	7r   c                 R    |                      t                      dddii           d S )Nr   r   r   )r/   r   r	   s    r   1test_for_json_encodes_object_nested_within_objectz=TestForJson.test_for_json_encodes_object_nested_within_object8   s7    OO
A'	) 	) 	) 	) 	)r   c                     |                      t                      t                                                                 d S r1   r/   r   r   r	   s    r   test_for_json_encodes_listz&TestForJson.test_for_json_encodes_list=   s>    MMMM""$$	& 	& 	& 	& 	&r   c                     |                      dt                      idt                                                      i           d S r   r>   r	   s    r   (test_for_json_encodes_list_within_objectz4TestForJson.test_for_json_encodes_list_within_objectB   sH    {}}%{}}--//0	2 	2 	2 	2 	2r   c                     |                      t          d          t          d                                                     d S )Nr   a)r/   r   r   r	   s    r   #test_for_json_encodes_dict_subclassz/TestForJson.test_for_json_encodes_dict_subclassG   sL    !!%%''	) 	) 	) 	) 	)r   c                     |                      t          dg          t          dg                                                     d S )Nl)r/   r"   r   r	   s    r   #test_for_json_encodes_list_subclassz/TestForJson.test_for_json_encodes_list_subclassL   sJ    ''))	+ 	+ 	+ 	+ 	+r   c                 `    dD ]*}|                      t          d          ddi|           +d S )NNFr   rC   rD   r'   )r/   r   r
   r   s     r   4test_for_json_ignored_if_not_true_with_dict_subclassz@TestForJson.test_for_json_ignored_if_not_true_with_dict_subclassQ   sU    % 	# 	#H  a   a! ! # # # #	# 	#r   c                 ^    dD ])}|                      t          dg          dg|           *d S )NrJ   rG   r'   )r/   r"   rK   s     r   4test_for_json_ignored_if_not_true_with_list_subclassz@TestForJson.test_for_json_ignored_if_not_true_with_list_subclassX   sR    % 	# 	#H  SE""! ! # # # #	# 	#r   c                     |                      t          t          j        t	                                 |                      t          t          j        t	                      d           d S )NFr'   )assertRaises	TypeErrorr(   r)   r   r	   s    r   6test_raises_typeerror_if_for_json_not_true_with_objectzBTestForJson.test_raises_typeerror_if_for_json_not_true_with_object_   sI    )TZ;;;)TZUKKKKKr   N)T)r   r   r   r/   r3   r6   r:   r<   r?   rA   rE   rH   rL   rN   rR   r   r   r   r%   r%      s           " " "
. . .
7 7 7
) ) )
& & &
2 2 2
) ) )
+ + +
# # ## # #L L L L Lr   r%   )unittest
simplejsonr(   objectr   r   r   dictr   r   r"   TestCaser%   r   r   r   <module>rX      s7           f   
% % % % %F % % %
    &   
    $   
    $   
CL CL CL CL CL(# CL CL CL CL CLr   