a 8dg} @sNddlmZGdddZGdddeZGdddeZGdd d eZd S) )CTestc@seZdZddZdS)BadBoolcCs dddSNrselfrr8/usr/local/lib/python3.9/test/test_json/test_speedups.py__bool__szBadBool.__bool__N)__name__ __module__ __qualname__r rrrr rsrc@seZdZddZddZdS) TestSpeedupscCs0||jjjjd||jjj|jjjdSNZ_json) assertEqualjsondecoderZ scanstringr assertIsZ c_scanstringrrrr test_scanstring szTestSpeedups.test_scanstringcCs0||jjjjd||jjj|jjjdSr)rrencoderZencode_basestring_asciir rZc_encode_basestring_asciirrrr test_encode_basestring_asciis  z)TestSpeedups.test_encode_basestring_asciiN)r r r rrrrrr r src@seZdZddZddZdS) TestDecodecCs|t|jjjddS)Nr) assertRaisesAttributeErrorrscannerZc_make_scannerrrrr test_make_scannerszTestDecode.test_make_scannercs,fdd}t|dt|ddS)Ncsjjjtd|dS)N)strict)rrZ JSONDecoderrdecode)valuerrr testsz+TestDecode.test_bad_bool_args..testz""z{}rZeroDivisionErrorrrrrr test_bad_bool_argss zTestDecode.test_bad_bool_argsN)r r r rr#rrrr rsrc@s,eZdZddZddZddZddZd S) TestEncodecCs|t|jjjddddS)N)TFs}=NLyR'J}u)r TypeErrorrrc_make_encoderrrrr test_make_encoder!s zTestEncode.test_make_encoderc Csdd}|jjddd|dddddd }|t|dd Wdn1sT0Y|t|dd id Wdn1s0Yd d }|jjdd d|dddddd }|t|dd Wdn1s0YdS)NcWsdSNrargsrrr bad_encoder1,sz5TestEncode.test_bad_str_encoder..bad_encoder1cSst|Sr(strobjrrr .z1TestEncode.test_bad_str_encoder..z: z, FZspam*cWs dddSrrr)rrr bad_encoder26sz5TestEncode.test_bad_str_encoder..bad_encoder2cSst|Sr(r,r.rrr r08r1)rrr&rr%r!)rr+encr4rrr test_bad_str_encoder)s  ( , zTestEncode.test_bad_str_encodercsVfdd}t|dt|dt|dt|dt|ddS)Ncs(jjjfi|tiddidS)Nar)rr JSONEncoderrencode)namerrr r?sz+TestEncode.test_bad_bool_args..testZskipkeysZ ensure_asciiZcheck_circularZ allow_nan sort_keysr r"rrr r#>s  zTestEncode.test_bad_bool_argscCsJ|t,|jjjdddddWdn1s<0YdS)NT)r;rr7)r7r)rr%rrr8r9rrrr test_unsortable_keysGs zTestEncode.test_unsortable_keysN)r r r r'r6r#r<rrrr r$ s r$N)Ztest.test_jsonrrrrr$rrrr s