#NEWLINE# def test_gops( self ) : #NEWLINE# #INDENT# 'Basic TreeNode operations should work as expected' #NEWLINE# p = TreeNode ( ) #NEWLINE# self . assertEqual ( str ( r ) , ';\n' ) #NEWLINE# p . name = 'abc' #NEWLINE# self . assertEqual ( str ( p ) , 'abc;\n' ) #NEWLINE# p . length = 3 #NEWLINE# self . assertEqual ( str ( p ) , 'abc:3;\n' ) #NEWLINE# q = TreeNode ( ) #NEWLINE# p . append ( q ) #NEWLINE# self . assertEqual ( str ( p ) , '()abc:3;\n' ) #NEWLINE# r = TreeNode ( ) #NEWLINE# q . append ( r ) #NEWLINE# self . assertEqual ( str ( p ) , '(())abc:3;\n' ) #NEWLINE# r . name = 'xyz' #NEWLINE# self . assertEqual ( str ( p ) , '((xyz))abc:3;\n' ) #NEWLINE# q . length = 2 #NEWLINE# self . assertEqual ( str ( p ) , '((xyz):2)abc:3;\n' )