B VXY" @sddlmZddlZddlZddlmZddlZddlmZmZmZddl m Z m Z m Z ddZ dd ZGd d d ZGd d d eZGdddeZdS))with_statementN)TestCase)encoderdecoderscanner)PY3 long_typebcCs tjdk S)N)rc_make_encoderr r Q/opt/alt/python37/lib64/python3.7/site-packages/simplejson/tests/test_speedups.py has_speedups sr csfdd}|S)Ncs6ts,ttdrtdntjddS||S)NSkipTestzC Extension not available)r hasattrunittestrsysstdoutwrite)argskwargs)funcr r wrappers    z)skip_if_speedups_missing..wrapperr )rrr )rr skip_if_speedups_missings rc@seZdZddZeZdS)BadBoolcCs dddS)Nrr )selfr r r __bool__szBadBool.__bool__N)__name__ __module__ __qualname__r __nonzero__r r r r rsrc@s$eZdZeddZeddZdS) TestDecodecCs|ttjddS)Nr) assertRaisesAttributeErrorrc_make_scanner)rr r r test_make_scanner$szTestDecode.test_make_scannercCsHdd}|t|d|t|dtsD|t|d|t|ddS)NcSstjtd|dS)N)strict)r JSONDecoderrdecode)valuer r r test*sz+TestDecode.test_bad_bool_args..testz""z{})r"ZeroDivisionErrorr)rr*r r r test_bad_bool_args(s zTestDecode.test_bad_bool_argsN)rrrrr%r,r r r r r!#s r!c@s@eZdZeddZeddZeddZer.testskipkeys ensure_asciicheck_circular allow_nan sort_keysZ use_decimalZnamedtuple_as_objectZtuple_as_arrayZbigint_as_stringZfor_jsonZ ignore_nanZiterable_as_array)r"r+)rr*r r r r,>szTestEncode.test_bad_bool_argscs0tdddfdd}|ttf|dS)N cstjdddS)N)Zint_as_string_bitcountr)rr0r1r ) long_countr r r*Rsz=TestEncode.test_int_as_string_bitcount_overflow..test)rr"r. OverflowError)rr*r )r;r $test_int_as_string_bitcount_overflowOs z/TestEncode.test_int_as_string_bitcount_overflowc Cs4|t tjddtddiWdQRXdS)Nu)encodingkey{)r"UnicodeEncodeErrorrr0r1r )rr r r test_bad_encodingWs zTestEncode.test_bad_encodingN) rrrrr/r,r=rrBr r r r r-2s   r-) __future__rrrr simplejsonrrrZsimplejson.compatrrr r rrr!r-r r r r s