o
    KXh                      @   sN   d dl mZ G dd dZG dd deZG dd deZG dd	 d	eZd
S )    )CTestc                   @   s   e Zd Zdd ZdS )BadBoolc                 C      dd  d S N   r    selfr   r   F/opt/python-3.10.19/usr/lib/python3.10/test/test_json/test_speedups.py__bool__      zBadBool.__bool__N)__name__
__module____qualname__r   r   r   r   r
   r      s    r   c                   @      e Zd Zdd Zdd ZdS )TestSpeedupsc                 C   0   |  | jjjjd | | jjj| jjj d S NZ_json)assertEqualjsondecoderZ
scanstringr   assertIsZc_scanstringr   r   r   r
   test_scanstring
   s   zTestSpeedups.test_scanstringc                 C   r   r   )r   r   encoderZencode_basestring_asciir   r   Zc_encode_basestring_asciir   r   r   r
   test_encode_basestring_ascii   s   z)TestSpeedups.test_encode_basestring_asciiN)r   r   r   r   r   r   r   r   r
   r   	   s    r   c                   @   r   )
TestDecodec                 C   s   |  t| jjjd d S )Nr   )assertRaisesAttributeErrorr   scannerZc_make_scannerr   r   r   r
   test_make_scanner   s   zTestDecode.test_make_scannerc                    s,    fdd}  t|d   t|d d S )Nc                    s    j jjt d|  d S )N)strict)r   r   ZJSONDecoderr   decode)valuer   r   r
   test   s   z+TestDecode.test_bad_bool_args.<locals>.testz""z{}r   ZeroDivisionErrorr	   r#   r   r   r
   test_bad_bool_args   s   zTestDecode.test_bad_bool_argsN)r   r   r   r   r'   r   r   r   r
   r      s    r   c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )
TestEncodec                 C   s   |  t| jjjddd  d S )N)TFs   }=NLyR'J}u)r   	TypeErrorr   r   c_make_encoderr   r   r   r
   test_make_encoder!   s
   zTestEncode.test_make_encoderc                 C   s   dd }| j jd dd |d ddddd	}| t |dd	 W d    n1 s*w   Y  | t |dd
id	 W d    n1 sFw   Y  dd }| j jd dd |d ddddd	}| t |dd	 W d    d S 1 svw   Y  d S )Nc                  W   s   d S Nr   argsr   r   r
   bad_encoder1,   s   z5TestEncode.test_bad_str_encoder.<locals>.bad_encoder1c                 S      t | S r,   strobjr   r   r
   <lambda>.       z1TestEncode.test_bad_str_encoder.<locals>.<lambda>: , FZspam   *   c                  W   r   r   r   r-   r   r   r
   bad_encoder26   r   z5TestEncode.test_bad_str_encoder.<locals>.bad_encoder2c                 S   r0   r,   r1   r3   r   r   r
   r5   8   r6   )r   r   r*   r   r)   r%   )r	   r/   encr;   r   r   r
   test_bad_str_encoder)   s&   "zTestEncode.test_bad_str_encoderc                 C   sP   |  td | jjdd d d ddddd	 W d    d S 1 s!w   Y  d S )Nz9make_encoder\(\) argument 1 must be dict or None, not intr   r7   r8   F)ZassertRaisesRegexr)   r   r   r*   r   r   r   r
   $test_bad_markers_argument_to_encoder>   s   "z/TestEncode.test_bad_markers_argument_to_encoderc                    sV    fdd}  t|d   t|d   t|d   t|d   t|d d S )Nc                    s(    j jjdi | t iddi d S )Nar   r   )r   r   JSONEncoderr   encode)namer   r   r
   r#   H   s   (z+TestEncode.test_bad_bool_args.<locals>.testZskipkeysZensure_asciiZcheck_circularZ	allow_nan	sort_keysr$   r&   r   r   r
   r'   G   s   zTestEncode.test_bad_bool_argsc                 C   sL   |  t | jjjddddd W d    d S 1 sw   Y  d S )NT)rC   r   r?   )r?   r   )r   r)   r   r   r@   rA   r   r   r   r
   test_unsortable_keysP   s   "zTestEncode.test_unsortable_keysN)r   r   r   r+   r=   r>   r'   rD   r   r   r   r
   r(       s    		r(   N)Ztest.test_jsonr   r   r   r   r(   r   r   r   r
   <module>   s
    