Hackfut Security File Manager
Current Path:
/usr/lib64/python2.6/site-packages/simplejson/tests
usr
/
lib64
/
python2.6
/
site-packages
/
simplejson
/
tests
/
📁
..
📄
__init__.py
(2.03 KB)
📄
__init__.pyc
(2.88 KB)
📄
__init__.pyo
(2.88 KB)
📄
test_check_circular.py
(917 B)
📄
test_check_circular.pyc
(2.11 KB)
📄
test_check_circular.pyo
(2.11 KB)
📄
test_decimal.py
(1.91 KB)
📄
test_decimal.pyc
(2.77 KB)
📄
test_decimal.pyo
(2.77 KB)
📄
test_decode.py
(3.21 KB)
📄
test_decode.pyc
(5.02 KB)
📄
test_decode.pyo
(5.02 KB)
📄
test_default.py
(222 B)
📄
test_default.pyc
(752 B)
📄
test_default.pyo
(752 B)
📄
test_dump.py
(984 B)
📄
test_dump.pyc
(1.96 KB)
📄
test_dump.pyo
(1.96 KB)
📄
test_encode_basestring_ascii.py
(2.25 KB)
📄
test_encode_basestring_ascii.pyc
(3.5 KB)
📄
test_encode_basestring_ascii.pyo
(3.5 KB)
📄
test_encode_for_html.py
(1.05 KB)
📄
test_encode_for_html.pyc
(1.88 KB)
📄
test_encode_for_html.pyo
(1.88 KB)
📄
test_errors.py
(1 KB)
📄
test_errors.pyc
(1.79 KB)
📄
test_errors.pyo
(1.79 KB)
📄
test_fail.py
(3.47 KB)
📄
test_fail.pyc
(2.59 KB)
📄
test_fail.pyo
(2.59 KB)
📄
test_float.py
(743 B)
📄
test_float.pyc
(1.33 KB)
📄
test_float.pyo
(1.33 KB)
📄
test_indent.py
(2.51 KB)
📄
test_indent.pyc
(2.9 KB)
📄
test_indent.pyo
(2.9 KB)
📄
test_namedtuple.py
(2.47 KB)
📄
test_namedtuple.pyc
(3.26 KB)
📄
test_namedtuple.pyo
(3.26 KB)
📄
test_pass1.py
(1.86 KB)
📄
test_pass1.pyc
(2.27 KB)
📄
test_pass1.pyo
(2.27 KB)
📄
test_pass2.py
(387 B)
📄
test_pass2.pyc
(828 B)
📄
test_pass2.pyo
(828 B)
📄
test_pass3.py
(483 B)
📄
test_pass3.pyc
(923 B)
📄
test_pass3.pyo
(923 B)
📄
test_recursion.py
(1.64 KB)
📄
test_recursion.pyc
(2.54 KB)
📄
test_recursion.pyo
(2.54 KB)
📄
test_scanstring.py
(3.96 KB)
📄
test_scanstring.pyc
(4.63 KB)
📄
test_scanstring.pyo
(4.63 KB)
📄
test_separators.py
(945 B)
📄
test_separators.pyc
(1.53 KB)
📄
test_separators.pyo
(1.53 KB)
📄
test_speedups.py
(592 B)
📄
test_speedups.pyc
(1.27 KB)
📄
test_speedups.pyo
(1.27 KB)
📄
test_tuple.py
(1.8 KB)
📄
test_tuple.pyc
(2.13 KB)
📄
test_tuple.pyo
(2.13 KB)
📄
test_unicode.py
(4.58 KB)
📄
test_unicode.pyc
(6.33 KB)
📄
test_unicode.pyo
(6.33 KB)
Editing: test_encode_basestring_ascii.py
from unittest import TestCase import simplejson.encoder CASES = [ (u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), (u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), (u'controls', '"controls"'), (u'\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'), (u'{"object with 1 member":["array with 1 element"]}', '"{\\"object with 1 member\\":[\\"array with 1 element\\"]}"'), (u' s p a c e d ', '" s p a c e d "'), (u'\U0001d120', '"\\ud834\\udd20"'), (u'\u03b1\u03a9', '"\\u03b1\\u03a9"'), ('\xce\xb1\xce\xa9', '"\\u03b1\\u03a9"'), (u'\u03b1\u03a9', '"\\u03b1\\u03a9"'), ('\xce\xb1\xce\xa9', '"\\u03b1\\u03a9"'), (u'\u03b1\u03a9', '"\\u03b1\\u03a9"'), (u'\u03b1\u03a9', '"\\u03b1\\u03a9"'), (u"`1~!@#$%^&*()_+-={':[,]}|;.</>?", '"`1~!@#$%^&*()_+-={\':[,]}|;.</>?"'), (u'\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'), (u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), ] class TestEncodeBaseStringAscii(TestCase): def test_py_encode_basestring_ascii(self): self._test_encode_basestring_ascii(simplejson.encoder.py_encode_basestring_ascii) def test_c_encode_basestring_ascii(self): if not simplejson.encoder.c_encode_basestring_ascii: return self._test_encode_basestring_ascii(simplejson.encoder.c_encode_basestring_ascii) def _test_encode_basestring_ascii(self, encode_basestring_ascii): fname = encode_basestring_ascii.__name__ for input_string, expect in CASES: result = encode_basestring_ascii(input_string) #self.assertEquals(result, expect, # '{0!r} != {1!r} for {2}({3!r})'.format( # result, expect, fname, input_string)) self.assertEquals(result, expect, '%r != %r for %s(%r)' % (result, expect, fname, input_string)) def test_sorted_dict(self): items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)] s = simplejson.dumps(dict(items), sort_keys=True) self.assertEqual(s, '{"five": 5, "four": 4, "one": 1, "three": 3, "two": 2}')
Upload File
Create Folder