ok

Mini Shell

Direktori : /usr/lib64/python2.7/site-packages/simplejson/tests/
Upload File :
Current File : //usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyo

�
��)Tc@sgddlmZddlmZmZmZmZmZddlZ	d�Z
defd��YZdS(i����(tTestCase(tStringIOt	long_typetbtbinary_typetPY3NcCs&tr"t|t�r"|jd�S|S(Ntascii(Rt
isinstanceRtdecode(ts((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pytas_text_types
tTestDumpcBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cCs3t�}tji|�|j|j�d�dS(Ns{}(RtjsontdumptassertEqualtgetvalue(tselftsio((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyt	test_dumps	cCs�x�dttgD]�}|jtjtj|��|k�|jtjtj|g��d|k�|jtjtji|d6��d|k�qWdS(Nita(tNonetTruetFalset
assertTrueRtloadstdumps(Rtc((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyttest_constantss%,c
Cs�td�dfddtdftdfdtd	�d
fg}xz|D]r\}}|jtjtji||6��i||6�|jtjtji||6dt��i||6�qFW|j	t
tjidt6�xiidd
6idtd�6dd6gD]�}x�ttgD]�}t|�}d|t<td�|j�D��}|jtjtj|dtd|��|�|jtjtji|d6dtd|��i|d6�|jtjtj|gdtd|��|g�qWqWdS(Ntbytesg�?s1.0i
t10ttruetfalsetnullidt100t	sort_keysitothertderpitherpcss'|]\}}t|�|fVqdS(N(R
(t.0tkeytval((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pys	<genexpr>*stskipkeyst(g�?s1.0(i
R(NR (
RRRRRRRRRtassertRaisest	TypeErrortdicttitems(RR.tktexpecttvR"tv0tv1((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyttest_stringify_keys:		"1
!($cCs|jtji�d�dS(Ns{}(RRR(R((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyt
test_dumps5scCs|jtjitt6tt6dt�d�|jtjidd6td�d6dt6ttd�6d	d
6dt�d�dS(NR"s{"false": true, "true": false}g@iig@iiit7s3{"2": 3.0, "4.0": 5, "6": true, "7": 0, "false": 1}(RRRRRR(R((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyttest_encode_truefalse8s



cCsAdd
dddg}tjtj|��}|j|d�dS(Ntoneittwoitthreeitfouritfiveis6{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}(R8i(R9i(R:i(R;i(R<i(RRtOrderedDictR(RR.R	((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyttest_ordered_dictFs
cCsNdtfd��Y}tjdddgd|d��}|j|d�d	S(
s�
        A test against the regression mentioned at `github issue 29`_.

        The indent parameter should accept any type which pretends to be
        an instance of int or long when it comes to being multiplied by
        strings, even if it is not actually an int or long, for
        backwards compatibility.

        .. _github issue 29:
           http://github.com/simplejson/simplejson/issue/29
        t
AwesomeIntcBs eZdZd�Zd�ZRS(s'An awesome reimplementation of integersc_s<t|�dkr8t|dt�r8|d|_q8ndS(Ni(tlenRtintt_int(Rtargstkwargs((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyt__init__^scSs*t|d�r|j|Std��dS(NRBsOTo do non-awesome things with this object, please construct it from an integer!(thasattrRBtNotImplementedError(RR#((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyt__mul__is(t__name__t
__module__t__doc__RERH(((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyR?[s	iiitindentis[
   0,
   1,
   2
]N(tobjectRRR(RR?R	((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyt#test_indent_unknown_type_acceptanceNs
$cCs3dgd}|jtjtj|��|�dS(Nii��(RRRR(Rtlst((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyttest_accumulatorvs
cCs�x�tdd�D]�}td�t|�D��}t�}tj||dt�|j|j�tj|dt��|jtj	|j��|�qWdS(Nii css!|]}t|�|fVqdS(N(tstr(R&tx((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pys	<genexpr>~sR"(
trangeR-RRR
RRRRR(Rtnum_keystpR((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyttest_sort_keys{s	%(RIRJRRR4R5R7R>RNRPRV(((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyR
s							(	(tunittestRtsimplejson.compatRRRRRt
simplejsonRR
R(((s@/usr/lib64/python2.7/site-packages/simplejson/tests/test_dump.pyt<module>s(	

Zerion Mini Shell 1.0