#NEWLINE# def test_submission_status_double_annos( ) : #NEWLINE# #INDENT# ssa = { #NEWLINE# #INDENT# 'longAnnos' : [ { #NEWLINE# #INDENT# 'isPrivate' : False , #NEWLINE# 'value' : 13 , #NEWLINE# 'key' : 'lucky' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'doubleAnnos' : [ { #NEWLINE# #INDENT# 'isPrivate' : False , #NEWLINE# 'value' : 3 , #NEWLINE# 'key' : 'three' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'isPrivate' : False , #NEWLINE# 'value' : pi , #NEWLINE# 'key' : 'pi' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# annotations = from_submission_status_annotations ( ssa ) #NEWLINE# assert isinstance ( annotations [ 'three' ] , float ) #NEWLINE# ssa2 = to_submission_status_annotations ( annotations ) #NEWLINE# assert ( set ( [ 'three' , 'pi' ] ) == set ( [ kvp [ 'key' ] for kvp in ssa2 [ 'doubleAnnos' ] ] ) ) #NEWLINE# assert ( set ( [ 'lucky' ] ) == set ( [ kvp [ 'key' ] for kvp in ssa2 [ 'longAnnos' ] ] ) )