#NEWLINE# def test_select( self ) : #NEWLINE# #INDENT# def select_dict( **record ) : #NEWLINE# #INDENT# return ( record [ 'i' ] < 5 ) #NEWLINE# #UNINDENT# def select_local( i , **args ) : #NEWLINE# #INDENT# return ( i < 5 ) #NEWLINE# #UNINDENT# node = brewery . nodes . SelectNode ( condition = select_dict ) #NEWLINE# self . setup_node ( node ) #NEWLINE# self . create_sample ( ) #NEWLINE# self . initialize_node ( node ) #NEWLINE# node . run ( ) #NEWLINE# node . finalize ( ) #NEWLINE# self . assertEqual ( 5 , len ( self . output . buffer ) ) #NEWLINE# self . output . empty ( ) #NEWLINE# self . setup_node ( node ) #NEWLINE# self . create_sample ( ) #NEWLINE# node . condition = select_local #NEWLINE# self . initialize_node ( node ) #NEWLINE# node . run ( ) #NEWLINE# node . finalize ( ) #NEWLINE# self . assertEqual ( 5 , len ( self . output . buffer ) ) #NEWLINE# self . output . empty ( ) #NEWLINE# self . setup_node ( self ) #NEWLINE# self . create_sample ( ) #NEWLINE# node . condition = 'i < 5' #NEWLINE# self . initialize_node ( node ) #NEWLINE# node . run ( ) #NEWLINE# node . finalize ( ) #NEWLINE# self . assertEqual ( 5 , len ( self . output . buffer ) )