Back to index

python3.2  3.2.2
Public Member Functions
test.json_tests.test_separators.TestSeparators Class Reference
Inheritance diagram for test.json_tests.test_separators.TestSeparators:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def test_separators

Detailed Description

Definition at line 5 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:


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