PATH:
opt
/
imunify360
/
venv
/
lib
/
python3.11
/
site-packages
/
simplejson
/
tests
import unittest import simplejson as json dct1 = { 'key1': 'value1' } dct2 = { 'key2': 'value2', 'd1': dct1 } dct3 = { 'key2': 'value2', 'd1': json.dumps(dct1) } dct4 = { 'key2': 'value2', 'd1': json.RawJSON(json.dumps(dct1)) } class TestRawJson(unittest.TestCase): def test_normal_str(self): self.assertNotEqual(json.dumps(dct2), json.dumps(dct3)) def test_raw_json_str(self): self.assertEqual(json.dumps(dct2), json.dumps(dct4)) self.assertEqual(dct2, json.loads(json.dumps(dct4))) def test_list(self): self.assertEqual( json.dumps([dct2]), json.dumps([json.RawJSON(json.dumps(dct2))])) self.assertEqual( [dct2], json.loads(json.dumps([json.RawJSON(json.dumps(dct2))]))) def test_direct(self): self.assertEqual( json.dumps(dct2), json.dumps(json.RawJSON(json.dumps(dct2)))) self.assertEqual( dct2, json.loads(json.dumps(json.RawJSON(json.dumps(dct2)))))
[-] test_separators.py
[edit]
[-] test_speedups.py
[edit]
[-] test_namedtuple.py
[edit]
[-] test_indent.py
[edit]
[-] test_check_circular.py
[edit]
[-] test_decode.py
[edit]
[-] test_dump.py
[edit]
[-] test_raw_json.py
[edit]
[+]
..
[-] _cibw_runner.py
[edit]
[-] test_unicode.py
[edit]
[-] test_float.py
[edit]
[-] test_errors.py
[edit]
[-] test_encode_basestring_ascii.py
[edit]
[-] test_subclass.py
[edit]
[-] test_decimal.py
[edit]
[-] test_encode_for_html.py
[edit]
[-] test_default.py
[edit]
[-] test_iterable.py
[edit]
[-] test_fail.py
[edit]
[-] test_bitsize_int_as_string.py
[edit]
[-] test_tool.py
[edit]
[+]
__pycache__
[-] test_bigint_as_string.py
[edit]
[-] test_for_json.py
[edit]
[-] test_pass3.py
[edit]
[-] test_pass2.py
[edit]
[-] test_item_sort_key.py
[edit]
[-] __init__.py
[edit]
[-] test_str_subclass.py
[edit]
[-] test_scanstring.py
[edit]
[-] test_recursion.py
[edit]
[-] test_tuple.py
[edit]
[-] test_pass1.py
[edit]