<s> import textwrap <EOL> from unittest import TestCase <EOL> import simplejson as S <EOL> class TestSeparators ( TestCase ) : <EOL> def test_separators ( self ) : <EOL> h = [ [ '<STR_LIT>' ] , [ '<STR_LIT>' ] , [ ] , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : <NUM_LIT> } , { '<STR_LIT>' : '<STR_LIT:yes>' , '<STR_LIT>' : False } ] <EOL> expect = textwrap . dedent ( """<STR_LIT>""" ) <EOL> d1 = S . dumps ( h ) <EOL> d2 = S . dumps ( h , indent = <NUM_LIT:2> , sort_keys = True , separators = ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> h1 = S . loads ( d1 ) <EOL> h2 = S . loads ( d2 ) <EOL> self . assertEquals ( h1 , h ) <EOL> self . assertEquals ( h2 , h ) <EOL> self . assertEquals ( d2 , expect ) </s>
