#NEWLINE# def test_merge_annotations__func__dict( self ) : #NEWLINE# #INDENT# ann1 = { #NEWLINE# #INDENT# 'val0' : 'val0' , #NEWLINE# 'val1' : 1 , #NEWLINE# 'val2' : 2.2 , #NEWLINE# 'val3' : 'test1' , #NEWLINE# 'val4' : [ 0.4 ] , #NEWLINE# 'val5' : { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# 1 : { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'val6' : np . array ( [ 0 , 1 , 2 ] ) , #NEWLINE# #UNINDENT# } #NEWLINE# ann2 = { #NEWLINE# #INDENT# 'val2' : 2.2 , #NEWLINE# 'val3' : 'test2' , #NEWLINE# 'val4' : [ 4 , 4.4 ] , #NEWLINE# 'val5' : { #NEWLINE# #INDENT# 1 : { #NEWLINE# #INDENT# 1 : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# 2 : 2 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'val6' : np . array ( [ 4 , 5 , 6 ] ) , #NEWLINE# 'val7' : True , #NEWLINE# #UNINDENT# } #NEWLINE# ann1c = ann1 . copy ( ) #NEWLINE# ann2c = ann2 . copy ( ) #NEWLINE# targ = { #NEWLINE# #INDENT# 'val0' : 'val0' , #NEWLINE# 'val1' : 1 , #NEWLINE# 'val2' : 2.2 , #NEWLINE# 'val3' : 'test1;test2' , #NEWLINE# 'val4' : [ 0.4 , 4 , 4.4 ] , #NEWLINE# 'val5' : { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# 1 : { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# 1 : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# 2 : 2 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'val7' : True , #NEWLINE# #UNINDENT# } #NEWLINE# res = merge_annotations ( ann1 , ann2 ) #NEWLINE# val6t = np . array ( [ 0 , 1 , 2 , 4 , 5 , 6 ] ) #NEWLINE# val6r = res . pop ( 'val6' ) #NEWLINE# val61 = ann1 . pop ( 'val6' ) #NEWLINE# val61c = ann1c . pop ( 'val6' ) #NEWLINE# val62 = ann2 . pop ( 'val6' ) #NEWLINE# val62c = ann2c . pop ( 'val6' ) #NEWLINE# self . assertEqual ( ann1 , ann1c ) #NEWLINE# self . assertEqual ( ann2 , ann2c ) #NEWLINE# self . assertEqual ( res , targ ) #NEWLINE# assert_arrays_equal ( val6r , val6t ) #NEWLINE# self . assertRaises ( AssertionError , assert_arrays_equal , val62 , val6t ) #NEWLINE# assert_arrays_equal ( val61 , val61c ) #NEWLINE# assert_arrays_equal ( val62 , val62c )