Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib64/python2.7/site-packages/simplejson/tests
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
simplejson
/
tests
/
📁
..
📄
__init__.py
(2.03 KB)
📄
__init__.pyc
(2.96 KB)
📄
__init__.pyo
(2.96 KB)
📄
test_check_circular.py
(917 B)
📄
test_check_circular.pyc
(2.21 KB)
📄
test_check_circular.pyo
(2.21 KB)
📄
test_decimal.py
(1.91 KB)
📄
test_decimal.pyc
(2.87 KB)
📄
test_decimal.pyo
(2.87 KB)
📄
test_decode.py
(3.21 KB)
📄
test_decode.pyc
(5.22 KB)
📄
test_decode.pyo
(5.22 KB)
📄
test_default.py
(222 B)
📄
test_default.pyc
(791 B)
📄
test_default.pyo
(791 B)
📄
test_dump.py
(984 B)
📄
test_dump.pyc
(2.04 KB)
📄
test_dump.pyo
(2.04 KB)
📄
test_encode_basestring_ascii.py
(2.25 KB)
📄
test_encode_basestring_ascii.pyc
(3.58 KB)
📄
test_encode_basestring_ascii.pyo
(3.58 KB)
📄
test_encode_for_html.py
(1.05 KB)
📄
test_encode_for_html.pyc
(1.95 KB)
📄
test_encode_for_html.pyo
(1.95 KB)
📄
test_errors.py
(1 KB)
📄
test_errors.pyc
(1.85 KB)
📄
test_errors.pyo
(1.85 KB)
📄
test_fail.py
(3.47 KB)
📄
test_fail.pyc
(2.64 KB)
📄
test_fail.pyo
(2.64 KB)
📄
test_float.py
(743 B)
📄
test_float.pyc
(1.38 KB)
📄
test_float.pyo
(1.38 KB)
📄
test_indent.py
(2.51 KB)
📄
test_indent.pyc
(2.98 KB)
📄
test_indent.pyo
(2.98 KB)
📄
test_namedtuple.py
(2.47 KB)
📄
test_namedtuple.pyc
(3.39 KB)
📄
test_namedtuple.pyo
(3.39 KB)
📄
test_pass1.py
(1.86 KB)
📄
test_pass1.pyc
(2.31 KB)
📄
test_pass1.pyo
(2.31 KB)
📄
test_pass2.py
(387 B)
📄
test_pass2.pyc
(867 B)
📄
test_pass2.pyo
(867 B)
📄
test_pass3.py
(483 B)
📄
test_pass3.pyc
(962 B)
📄
test_pass3.pyo
(962 B)
📄
test_recursion.py
(1.64 KB)
📄
test_recursion.pyc
(2.64 KB)
📄
test_recursion.pyo
(2.64 KB)
📄
test_scanstring.py
(3.96 KB)
📄
test_scanstring.pyc
(4.71 KB)
📄
test_scanstring.pyo
(4.71 KB)
📄
test_separators.py
(945 B)
📄
test_separators.pyc
(1.56 KB)
📄
test_separators.pyo
(1.56 KB)
📄
test_speedups.py
(592 B)
📄
test_speedups.pyc
(1.34 KB)
📄
test_speedups.pyo
(1.34 KB)
📄
test_tuple.py
(1.8 KB)
📄
test_tuple.pyc
(2.21 KB)
📄
test_tuple.pyo
(2.21 KB)
📄
test_unicode.py
(4.58 KB)
📄
test_unicode.pyc
(6.57 KB)
📄
test_unicode.pyo
(6.57 KB)
Editing: test_pass1.py
from unittest import TestCase import simplejson as json # from http://json.org/JSON_checker/test/pass1.json JSON = r''' [ "JSON Test Pattern pass1", {"object with 1 member":["array with 1 element"]}, {}, [], -42, true, false, null, { "integer": 1234567890, "real": -9876.543210, "e": 0.123456789e-12, "E": 1.234567890E+34, "": 23456789012E666, "zero": 0, "one": 1, "space": " ", "quote": "\"", "backslash": "\\", "controls": "\b\f\n\r\t", "slash": "/ & \/", "alpha": "abcdefghijklmnopqrstuvwyz", "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", "digit": "0123456789", "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?", "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", "true": true, "false": false, "null": null, "array":[ ], "object":{ }, "address": "50 St. James Street", "url": "http://www.JSON.org/", "comment": "// /* <!-- --", "# -- --> */": " ", " s p a c e d " :[1,2 , 3 , 4 , 5 , 6 ,7 ], "compact": [1,2,3,4,5,6,7], "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", "quotes": "" \u0022 %22 0x22 034 "", "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" : "A key can be any string" }, 0.5 ,98.6 , 99.44 , 1066 ,"rosebud"] ''' class TestPass1(TestCase): def test_parse(self): # test in/out equivalence and parsing res = json.loads(JSON) out = json.dumps(res) self.assertEquals(res, json.loads(out)) try: json.dumps(res, allow_nan=False) except ValueError: pass else: self.fail("23456789012E666 should be out of range")
Upload File
Create Folder