#NEWLINE# def test_find_cache_bug( self ) : #NEWLINE# #INDENT# 'First implementation did not force the cache to be at the root' #NEWLINE# t = TreeNode . read ( io . StringIO ( '((a,b)c,(d,e)f,(g,h)f);' ) ) #NEWLINE# exp_tip_cache_keys = set ( [ 'a' , 'b' , 'd' , 'e' , 'g' , 'h' ] ) #NEWLINE# exp_non_tip_cache_keys = set ( [ 'c' , 'f' ] ) #NEWLINE# tip_a = t . children [ 0 ] . children [ 0 ] #NEWLINE# tip_a . create_caches ( ) #NEWLINE# self . assertEqual ( tip_a . _tip_cache , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( set ( t . _tip_cache ) , exp_tip_cache_keys ) #NEWLINE# self . assertEqual ( set ( t . _non_tip_cache ) , exp_non_tip_cache_keys ) #NEWLINE# self . assertEqual ( t . _non_tip_cache [ 'f' ] , [ t . children [ 1 ] , t . children [ 2 ] ] )