Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.json_tests.test_encode_basestring_ascii.TestPyEncodeBasestringAscii Class Reference
Inheritance diagram for test.json_tests.test_encode_basestring_ascii.TestPyEncodeBasestringAscii:
Inheritance graph
[legend]
Collaboration diagram for test.json_tests.test_encode_basestring_ascii.TestPyEncodeBasestringAscii:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_encode_basestring_ascii
def test_ordered_dict
def test_sorted_dict

Static Public Attributes

 json = pyjson
tuple loads = staticmethod(pyjson.loads)
tuple dumps = staticmethod(pyjson.dumps)

Detailed Description

Definition at line 43 of file test_encode_basestring_ascii.py.


Member Function Documentation

Definition at line 23 of file test_encode_basestring_ascii.py.

00023 
00024     def test_encode_basestring_ascii(self):
00025         fname = self.json.encoder.encode_basestring_ascii.__name__
00026         for input_string, expect in CASES:
00027             result = self.json.encoder.encode_basestring_ascii(input_string)
00028             self.assertEqual(result, expect,
00029                 '{0!r} != {1!r} for {2}({3!r})'.format(
00030                     result, expect, fname, input_string))

Here is the call graph for this function:

Definition at line 31 of file test_encode_basestring_ascii.py.

00031 
00032     def test_ordered_dict(self):
00033         # See issue 6105
00034         items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)]
00035         s = self.dumps(OrderedDict(items))
00036         self.assertEqual(s, '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}')

Here is the call graph for this function:

Definition at line 37 of file test_encode_basestring_ascii.py.

00037 
00038     def test_sorted_dict(self):
00039         items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)]
00040         s = self.dumps(dict(items), sort_keys=True)
00041         self.assertEqual(s, '{"five": 5, "four": 4, "one": 1, "three": 3, "two": 2}')
00042 

Here is the call graph for this function:


Member Data Documentation

tuple test.json_tests.PyTest.dumps = staticmethod(pyjson.dumps) [static, inherited]

Definition at line 17 of file __init__.py.

test.json_tests.PyTest.json = pyjson [static, inherited]

Definition at line 15 of file __init__.py.

tuple test.json_tests.PyTest.loads = staticmethod(pyjson.loads) [static, inherited]

Definition at line 16 of file __init__.py.


The documentation for this class was generated from the following file: