#NEWLINE# def test_crazy_addchild_ordering( self ) : #NEWLINE# #INDENT# bm = core . JSONableDict ( ) #NEWLINE# tr1 = TestResource ( { #NEWLINE# #INDENT# 'Id' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# tr2 = TestResource ( { #NEWLINE# #INDENT# 'Id' : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# bm . add ( tr1 ) #NEWLINE# added_resource = bm . add ( tr1 ) #NEWLINE# self . assertIs ( bm , tr1 ) #NEWLINE# tr1 . add ( tr2 ) #NEWLINE# self . assertIn ( 'TestResource' , bm [ 'TestResource' ] ) #NEWLINE# self . assertEqual ( bm [ 'TestResource' ] [ 'Id' ] , 1 ) #NEWLINE# self . assertEqual ( bm [ 'TestResource' ] [ 'TestResource' ] [ 'Id' ] , 2 ) #NEWLINE# tr2 . update ( { #NEWLINE# #INDENT# 'This Is' : 'A Test' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( bm [ 'TestResource' ] [ 'TestResource' ] [ 'This Is' ] , 'A Test' )