
    DUf!                     V    d dl Z d dlZd dlmZ d dlZd dlmZmZ  G d de          Z	dS )    N)TestCase)	text_typebc                   ,    e Zd Zd Zd Zd Zd Zd ZdS )
TestErrorsc                    dddddg}	 t          j        |           |                     d           n)# t          $ r t	          j                    d         }Y nw xY w|                     t          |          d           d S )	NA)      g      @zD tuple)ar   c)dExpected TypeError   z5keys must be str, int, float, bool or None, not tuplejsondumpsfail	TypeErrorsysexc_infoassertEqualstr)selfdataerrs      Y/var/www/html/software/conda/lib/python3.11/site-packages/simplejson/tests/test_errors.pytest_string_keys_errorz!TestErrors.test_string_keys_error   s    S)DDE	,Jt II*++++  	$ 	$ 	$,..#CCC	$ 	SG	I 	I 	I 	I 	Is   4 #AAc                     	 t          j        t                      |                     d           n)# t          $ r t	          j                    d         }Y nw xY w|                     t          |          d           d S )Nr   r   z.Object of type module is not JSON serializabler   r   r   s     r   test_not_serializablez TestErrors.test_not_serializable   s    	,Jt II*++++  	$ 	$ 	$,..#CCC	$ 	S@	B 	B 	B 	B 	Bs   1 #AAc                    d }	 t          j        d           |                     d           n.# t           j        $ r t	          j                    d         }Y nw xY w|                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d           d S )N{}
a
bExpected JSONDecodeErrorr   r
      )r   loadsr   JSONDecodeErrorr   r   r   linenocolno	endlinenoendcolnor    s     r   test_decode_errorzTestErrors.test_decode_error   s    	2Jz""" II01111 # 	$ 	$ 	$,..#CCC	$ 	Q'''A&&&***q)))))   . (AAc                 \   d }t           t          fD ]}	 t          j         |d                     |                     d           n.# t          j        $ r t          j                    d         }Y nw xY w|                     |j	        d           |                     |j
        d           d S )Nz
{"asdf": "r$   r   
   )r   r   r   r&   r   r'   r   r   r   r(   r)   )r   r   ts      r   test_scan_errorzTestErrors.test_scan_error*   s    Q 	, 	,A6
11\??+++ 		45555 ' ( ( (lnnQ'( SZ+++SY++++	, 	,s   A(A21A2c                    d }	 t          j        d           |                     d           n.# t           j        $ r t	          j                    d         }Y nw xY wt          j        |          }t          j        |          }|                     |j	        |j	                   |                     |j
        |j
                   |                     |j        |j                   |                     |j        |j                   d S )Nr#   r$   r   )r   r&   r   r'   r   r   pickler   r   msgdocposend)r   r   ses       r   test_error_is_pickablez!TestErrors.test_error_is_pickable6   s    	2Jz""" II01111 # 	$ 	$ 	$,..#CCC	$ LLOO!%(((!%(((!%(((!%(((((r-   N)__name__
__module____qualname__r   r!   r,   r1   r:        r   r   r      se        	I 	I 	IB B B* * *
, 
, 
,) ) ) ) )r?   r   )
r   r3   unittestr   
simplejsonr   simplejson.compatr   r   r   r>   r?   r   <module>rC      s                      * * * * * * * *=) =) =) =) =) =) =) =) =) =)r?   