#NEWLINE# def test_cache( self ) : #NEWLINE# #INDENT# l = ast . Literal ( 'foo' ) #NEWLINE# v = ast . Number ( 42 ) #NEWLINE# gt1 = ast . CompareOperator ( '>' , l , v ) #NEWLINE# l1 = ast . Literal ( 'foo' ) #NEWLINE# v1 = ast . Number ( 42 ) #NEWLINE# gt2 = ast . CompareOperator ( '>' , self , v1 ) #NEWLINE# n = ast . LogicalOperator ( 'or' , gt1 , gt2 ) #NEWLINE# cache . cache_expressions ( n ) #NEWLINE# assert ( n . left is n . right ) #NEWLINE# assert ( n . left . cache_id == 0 )