#NEWLINE# def test_json_serialization( self ) : #NEWLINE# #INDENT# 'ValueRef JSON is correctly serialized' #NEWLINE# vref = ValueRef ( ) #NEWLINE# nt . assert_equal ( json . dumps ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , vref . to_json ( pretty_print = False ) ) #NEWLINE# props = { #NEWLINE# #INDENT# 'value' : 'test-value' , #NEWLINE# 'band' : True , #NEWLINE# #UNINDENT# } #NEWLINE# vref = ValueRef ( ** props ) #NEWLINE# nt . assert_equal ( json . dumps ( props , sort_keys = True ) , vref . to_json ( pretty_print = False ) ) #NEWLINE# props = { #NEWLINE# #INDENT# 'value' : 'test-value' , #NEWLINE# 'field' : 'test-field' , #NEWLINE# 'scale' : 'test-scale' , #NEWLINE# 'mult' : 1.2 , #NEWLINE# 'offset' : 4 , #NEWLINE# 'band' : True , #NEWLINE# #UNINDENT# } #NEWLINE# vref = ValueRef ( ** props ) #NEWLINE# nt . assert_equal ( json . dumps ( props , sort_keys = True ) , vref . to_json ( pretty_print = False ) )