def test_callable_filter():
 def my_filter(_in, out):
  assert (_in.read() == 'initial value')
  out.write('filter was here')
 with TempEnvironmentHelper() as helper:
  helper.create_files({'in': 'initial value'})
  b = helper.mkbundle('in', filters=my_filter, output='out')
  b.build()
  assert (helper.get('out') == 'filter was here')

def test_callable_filter ( ) : def my_filter ( _in , out ) : assert ( _in . read ( ) == 'initial value' ) out . write ( 'filter was here' ) with TempEnvironmentHelper ( ) as helper : helper . create_files ( { 'in' : 'initial value' } ) b = helper . mkbundle ( 'in' , filters = my_filter , output = 'out' ) b . build ( ) assert ( helper . get ( 'out' ) == 'filter was here' )
simple callables can be used as filters .