/opt/cloudlinux/venv/lib/python3.11/site-packages/simplejson/tests
NameSizeModeActions
__pycache__/-0755rm
test_bigint_as_string.py22380644editdlrm
test_bitsize_int_as_string.py22970644editdlrm
test_check_circular.py9170644editdlrm
test_decimal.py25440644editdlrm
test_decode.py51810644editdlrm
test_default.py2210644editdlrm
test_dump.py103560644editdlrm
test_encode_basestring_ascii.py23370644editdlrm
test_encode_for_html.py15150644editdlrm
test_errors.py20810644editdlrm
test_fail.py64540644editdlrm
test_float.py16760644editdlrm
test_for_json.py27670644editdlrm
test_indent.py25680644editdlrm
test_item_sort_key.py13760644editdlrm
test_iterable.py13900644editdlrm
test_namedtuple.py58960644editdlrm
test_pass1.py17460644editdlrm
test_pass2.py3860644editdlrm
test_pass3.py4820644editdlrm
test_raw_json.py10620644editdlrm
test_recursion.py16790644editdlrm
test_scanstring.py76480644editdlrm
test_separators.py9420644editdlrm
test_speedups.py41440644editdlrm
test_str_subclass.py7400644editdlrm
test_subclass.py11240644editdlrm
test_tool.py33040644editdlrm
test_tuple.py18310644editdlrm
test_unicode.py70560644editdlrm
_cibw_runner.py1730644editdlrm
__init__.py25120644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/simplejson/tests/test_bigint_as_string.py (2238B)
from unittest import TestCase import simplejson as json class TestBigintAsString(TestCase): # Python 2.5, at least the one that ships on Mac OS X, calculates # 2 ** 53 as 0! It manages to calculate 1 << 53 correctly. values = [(200, 200), ((1 << 53) - 1, 9007199254740991), ((1 << 53), '9007199254740992'), ((1 << 53) + 1, '9007199254740993'), (-100, -100), ((-1 << 53), '-9007199254740992'), ((-1 << 53) - 1, '-9007199254740993'), ((-1 << 53) + 1, -9007199254740991)] options = ( {"bigint_as_string": True}, {"int_as_string_bitcount": 53} ) def test_ints(self): for opts in self.options: for val, expect in self.values: self.assertEqual( val, json.loads(json.dumps(val))) self.assertEqual( expect, json.loads(json.dumps(val, **opts))) def test_lists(self): for opts in self.options: for val, expect in self.values: val = [val, val] expect = [expect, expect] self.assertEqual( val, json.loads(json.dumps(val))) self.assertEqual( expect, json.loads(json.dumps(val, **opts))) def test_dicts(self): for opts in self.options: for val, expect in self.values: val = {'k': val} expect = {'k': expect} self.assertEqual( val, json.loads(json.dumps(val))) self.assertEqual( expect, json.loads(json.dumps(val, **opts))) def test_dict_keys(self): for opts in self.options: for val, _ in self.values: expect = {str(val): 'value'} val = {val: 'value'} self.assertEqual( expect, json.loads(json.dumps(val))) self.assertEqual( expect, json.loads(json.dumps(val, **opts)))