✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python27/lib64/python2.7/site-packages/simplejson/tests//test_indent.py
from unittest import TestCase

import simplejson as json
import textwrap
from StringIO import StringIO

class TestIndent(TestCase):
    def test_indent(self):
        h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh',
             'i-vhbjkhnth',
             {'nifty': 87}, {'field': 'yes', 'morefield': False} ]

        expect = textwrap.dedent("""\
        [
        \t[
        \t\t"blorpie"
        \t],
        \t[
        \t\t"whoops"
        \t],
        \t[],
        \t"d-shtaeou",
        \t"d-nthiouh",
        \t"i-vhbjkhnth",
        \t{
        \t\t"nifty": 87
        \t},
        \t{
        \t\t"field": "yes",
        \t\t"morefield": false
        \t}
        ]""")


        d1 = json.dumps(h)
        d2 = json.dumps(h, indent='\t', sort_keys=True, separators=(',', ': '))
        d3 = json.dumps(h, indent='  ', sort_keys=True, separators=(',', ': '))
        d4 = json.dumps(h, indent=2, sort_keys=True, separators=(',', ': '))

        h1 = json.loads(d1)
        h2 = json.loads(d2)
        h3 = json.loads(d3)
        h4 = json.loads(d4)

        self.assertEquals(h1, h)
        self.assertEquals(h2, h)
        self.assertEquals(h3, h)
        self.assertEquals(h4, h)
        self.assertEquals(d3, expect.replace('\t', '  '))
        self.assertEquals(d4, expect.replace('\t', '  '))
        # NOTE: Python 2.4 textwrap.dedent converts tabs to spaces,
        #       so the following is expected to fail. Python 2.4 is not a
        #       supported platform in simplejson 2.1.0+.
        self.assertEquals(d2, expect)

    def test_indent0(self):
        h = {3: 1}
        def check(indent, expected):
            d1 = json.dumps(h, indent=indent)
            self.assertEquals(d1, expected)

            sio = StringIO()
            json.dump(h, sio, indent=indent)
            self.assertEquals(sio.getvalue(), expected)

        # indent=0 should emit newlines
        check(0, '{\n"3": 1\n}')
        # indent=None is more compact
        check(None, '{"3": 1}')

    def test_separators(self):
        lst = [1,2,3,4]
        expect = '[\n1,\n2,\n3,\n4\n]'
        expect_spaces = '[\n1, \n2, \n3, \n4\n]'
        # Ensure that separators still works
        self.assertEquals(
            expect_spaces,
            json.dumps(lst, indent=0, separators=(', ', ': ')))
        # Force the new defaults
        self.assertEquals(
            expect,
            json.dumps(lst, indent=0, separators=(',', ': ')))
        # Added in 2.1.4
        self.assertEquals(
            expect,
            json.dumps(lst, indent=0))


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jul 2024 8.45 AM
root / linksafe
0755
__init__.py
2.026 KB
4 Sep 2011 6.21 PM
root / linksafe
0644
__init__.pyc
2.951 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_check_circular.py
0.896 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_check_circular.pyc
2.212 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_decimal.py
1.912 KB
4 Sep 2011 8.42 AM
root / linksafe
0644
test_decimal.pyc
2.859 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_decode.py
3.21 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_decode.pyc
5.224 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_default.py
0.217 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_default.pyc
0.772 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_dump.py
0.961 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_dump.pyc
2.037 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_encode_basestring_ascii.py
2.247 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_encode_basestring_ascii.pyc
3.577 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_encode_for_html.py
1.052 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_encode_for_html.pyc
1.952 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_errors.py
1 KB
4 Sep 2011 1.48 AM
root / linksafe
0644
test_errors.pyc
1.849 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_fail.py
3.472 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_fail.pyc
2.63 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_float.py
0.726 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_float.pyc
1.38 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_indent.py
2.51 KB
12 Apr 2011 6.31 PM
root / linksafe
0644
test_indent.pyc
2.98 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_namedtuple.py
2.474 KB
4 Sep 2011 6.21 PM
root / linksafe
0644
test_namedtuple.pyc
3.386 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_pass1.py
1.858 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_pass1.pyc
2.304 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_pass2.py
0.378 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_pass2.pyc
0.847 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_pass3.py
0.472 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_pass3.pyc
0.939 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_recursion.py
1.641 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_recursion.pyc
2.627 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_scanstring.py
3.965 KB
12 Apr 2011 6.31 PM
root / linksafe
0644
test_scanstring.pyc
4.71 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_separators.py
0.923 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_separators.pyc
1.564 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_speedups.py
0.578 KB
11 Mar 2011 5.03 PM
root / linksafe
0644
test_speedups.pyc
1.333 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_tuple.py
1.799 KB
4 Sep 2011 6.10 PM
root / linksafe
0644
test_tuple.pyc
2.208 KB
21 Oct 2019 3.47 PM
root / linksafe
0644
test_unicode.py
4.577 KB
16 May 2011 2.18 AM
root / linksafe
0644
test_unicode.pyc
6.566 KB
21 Oct 2019 3.47 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF