#NEWLINE# def test_pop( self ) : #NEWLINE# #INDENT# 'Pop off a node' #NEWLINE# second_tree = TreeNode . read ( io . StringIO ( '(x1,y1)z1;' ) ) #NEWLINE# third_tree = TreeNode . read ( io . StringIO ( '(x2,y2)z2;' ) ) #NEWLINE# self . simple_t . extend ( [ second_tree , third_tree ] ) #NEWLINE# i1 = self . simple_t . pop ( 0 ) #NEWLINE# z2 = self . simple_t . pop ( ) #NEWLINE# self . assertEqual ( i1 . name , 'i1' ) #NEWLINE# self . assertEqual ( z2 . name , 'z2' ) #NEWLINE# self . assertEqual ( i1 . children [ 0 ] . name , 'a' ) #NEWLINE# self . assertEqual ( i1 . children [ 1 ] . name , 'b' ) #NEWLINE# self . assertEqual ( z2 . children [ 0 ] . name , 'x2' ) #NEWLINE# self . assertEqual ( z2 . children [ 1 ] . name , 'y2' ) #NEWLINE# self . assertEqual ( self . simple_t . children [ 0 ] . name , 'i2' ) #NEWLINE# self . assertEqual ( self . simple_t . children [ 1 ] . name , 'z1' ) #NEWLINE# self . assertEqual ( len ( self . simple_t . children ) , 2 )