
    "Ie
                         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y)    Nc                       e Zd Zd Zy)ForJsonc                 
    ddiS )Nfor_json    selfs    @/usr/lib/python3/dist-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y)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y)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y)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y)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                   V    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y)TestForJsonc                     |t        j                  |      }nt        j                  ||      }| j                  t        j                  |      |       y )Nr   )jsondumpsassertEqualloads)r
   objotherr   ss        r   assertRoundTripzTestForJson.assertRoundTrip   sA    

3A

32AJJqM	r   c                 d    | j                  t               t               j                                y Nr/   r   r   r	   s    r   (test_for_json_encodes_stand_alone_objectz4TestForJson.test_for_json_encodes_stand_alone_object)   s#    II 	"r   c                 l    | j                  dt               idt               j                         i       y )Nhoorayr2   r	   s    r   +test_for_json_encodes_object_nested_in_dictz7TestForJson.test_for_json_encodes_object_nested_in_dict.   s-    wy!wy))+,	.r   c                 |    | j                  ddt               ddgiddt               j                         ddgi       y )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   s?    aAq)*a++-q!45	7r   c                 @    | j                  t               dddii       y )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   s!    O
A'	)r   c                 d    | j                  t               t               j                                y r1   r/   r   r   r	   s    r   test_for_json_encodes_listz&TestForJson.test_for_json_encodes_list=   s#    MM""$	&r   c                 l    | j                  dt               idt               j                         i       y r   r>   r	   s    r   (test_for_json_encodes_list_within_objectz4TestForJson.test_for_json_encodes_list_within_objectB   s-    {}%{}--/0	2r   c                 l    | j                  t        d      t        d      j                                y )Nr   a)r/   r   r   r	   s    r   #test_for_json_encodes_dict_subclassz/TestForJson.test_for_json_encodes_dict_subclassG   s)    !!%%'	)r   c                 l    | j                  t        dg      t        dg      j                                y )Nl)r/   r"   r   r	   s    r   #test_for_json_encodes_list_subclassz/TestForJson.test_for_json_encodes_list_subclassL   s-    '')	+r   c                 R    dD ]"  }| j                  t        d      ddi|       $ y )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   s6    % 	#H  a a! ! #	#r   c                 P    dD ]!  }| j                  t        dg      dg|       # y )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   s6    % 	#H  SE"! ! #	#r   c                     | j                  t        t        j                  t	                      | j                  t        t        j                  t	               d       y )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_   s7    )TZZ;)TZZU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
)
&
2
)
+
##Lr   r%   )unittest
simplejsonr(   objectr   r   r   dictr   r   r"   TestCaser%   r   r   r   <module>rX      s]     f 
%F %
& 
$ 
$ 
CL(## CLr   