#NEWLINE# def test_tree_level_lists( self ) : #NEWLINE# #INDENT# node = Node ( 5 ) #NEWLINE# insert ( node , 3 ) #NEWLINE# insert ( node , 8 ) #NEWLINE# insert ( node , 2 ) #NEWLINE# insert ( node , 4 ) #NEWLINE# insert ( node , 1 ) #NEWLINE# insert ( node , 7 ) #NEWLINE# insert ( node , 6 ) #NEWLINE# insert ( node , 9 ) #NEWLINE# insert ( node , 10 ) #NEWLINE# insert ( node , 11 ) #NEWLINE# levels = create_level_lists ( node ) #NEWLINE# results_list = [ ] #NEWLINE# for level in levels : #NEWLINE# #INDENT# results = Results ( ) #NEWLINE# for node in level : #NEWLINE# #INDENT# results . add_result ( node ) #NEWLINE# #UNINDENT# results_list . append ( results ) #NEWLINE# #UNINDENT# assert_equal ( str ( results_list [ 0 ] ) , '[5]' ) #NEWLINE# assert_equal ( str ( results_list [ 1 ] ) , '[3, 8]' ) #NEWLINE# assert_equal ( str ( results_list [ 2 ] ) , '[2, 4, 7, 9]' ) #NEWLINE# assert_equal ( str ( results_list [ 3 ] ) , '[1, 6, 10]' ) #NEWLINE# assert_equal ( str ( levels [ 4 ] ) , '[11]' ) #NEWLINE# print ( 'Success: test_tree_level_lists' )