/opt/imunify360/venv/lib/python3.11/site-packages/simplejson/tests
NameSizeModeActions
__pycache__/-0755rm
test_bigint_as_string.py22380644editdlrm
test_bitsize_int_as_string.py45350644editdlrm
test_check_circular.py15790644editdlrm
test_decimal.py25440644editdlrm
test_decode.py74700644editdlrm
test_default.py2210644editdlrm
test_dump.py176000644editdlrm
test_encode_basestring_ascii.py23370644editdlrm
test_encode_for_html.py15150644editdlrm
test_errors.py35030644editdlrm
test_fail.py64540644editdlrm
test_float.py19830644editdlrm
test_for_json.py41260644editdlrm
test_free_threading.py31690644editdlrm
test_indent.py25680644editdlrm
test_item_sort_key.py13760644editdlrm
test_iterable.py25800644editdlrm
test_namedtuple.py73910644editdlrm
test_pass1.py17460644editdlrm
test_pass2.py3860644editdlrm
test_pass3.py4820644editdlrm
test_raw_json.py10620644editdlrm
test_recursion.py16790644editdlrm
test_scanstring.py120980644editdlrm
test_separators.py9420644editdlrm
test_speedups.py125900644editdlrm
test_str_subclass.py7400644editdlrm
test_subclass.py11240644editdlrm
test_subinterpreters.py46390644editdlrm
test_tool.py29960644editdlrm
test_tuple.py18310644editdlrm
test_unicode.py70560644editdlrm
_cibw_runner.py1730644editdlrm
_helpers.py4050644editdlrm
__init__.py29170644editdlrm
Edit: /opt/imunify360/venv/lib/python3.11/site-packages/simplejson/tests/test_item_sort_key.py (1376B)
from unittest import TestCase import simplejson as json from operator import itemgetter class TestItemSortKey(TestCase): def test_simple_first(self): a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'} self.assertEqual( '{"a": 1, "c": 5, "crate": "dog", "jack": "jill", "pick": "axe", "zeak": "oh", "array": [1, 5, 6, 9], "tuple": [83, 12, 3]}', json.dumps(a, item_sort_key=json.simple_first)) def test_case(self): a = {'a': 1, 'c': 5, 'Jack': 'jill', 'pick': 'axe', 'Array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'} self.assertEqual( '{"Array": [1, 5, 6, 9], "Jack": "jill", "a": 1, "c": 5, "crate": "dog", "pick": "axe", "tuple": [83, 12, 3], "zeak": "oh"}', json.dumps(a, item_sort_key=itemgetter(0))) self.assertEqual( '{"a": 1, "Array": [1, 5, 6, 9], "c": 5, "crate": "dog", "Jack": "jill", "pick": "axe", "tuple": [83, 12, 3], "zeak": "oh"}', json.dumps(a, item_sort_key=lambda kv: kv[0].lower())) def test_item_sort_key_value(self): # https://github.com/simplejson/simplejson/issues/173 a = {'a': 1, 'b': 0} self.assertEqual( '{"b": 0, "a": 1}', json.dumps(a, item_sort_key=lambda kv: kv[1]))