Back to index

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

List of all members.

Public Member Functions

def test_separators

Static Public Attributes

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

Detailed Description

Definition at line 43 of file test_separators.py.


Member Function Documentation

Definition at line 6 of file test_separators.py.

00006 
00007     def test_separators(self):
00008         h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',
00009              {'nifty': 87}, {'field': 'yes', 'morefield': False} ]
00010 
00011         expect = textwrap.dedent("""\
00012         [
00013           [
00014             "blorpie"
00015           ] ,
00016           [
00017             "whoops"
00018           ] ,
00019           [] ,
00020           "d-shtaeou" ,
00021           "d-nthiouh" ,
00022           "i-vhbjkhnth" ,
00023           {
00024             "nifty" : 87
00025           } ,
00026           {
00027             "field" : "yes" ,
00028             "morefield" : false
00029           }
00030         ]""")
00031 
00032 
00033         d1 = self.dumps(h)
00034         d2 = self.dumps(h, indent=2, sort_keys=True, separators=(' ,', ' : '))
00035 
00036         h1 = self.loads(d1)
00037         h2 = self.loads(d2)
00038 
00039         self.assertEqual(h1, h)
00040         self.assertEqual(h2, h)
00041         self.assertEqual(d2, expect)
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: