def test_register_filter():
 assert_raises(ValueError, register_filter, object)
 class MyFilter(Filter, ):
  name = None
  def output(self, *a, **kw):
   pass
 assert_raises(ValueError, register_filter, MyFilter)
 MyFilter.name = 'foo'
 register_filter(MyFilter)
 class OverrideMyFilter(Filter, ):
  name = 'foo'
  def output(self, *a, **kw):
   pass
 register_filter(OverrideMyFilter)
 assert_true(isinstance(get_filter('foo'), OverrideMyFilter))

def test_register_filter ( ) : assert_raises ( ValueError , register_filter , object ) class MyFilter ( Filter , ) : name = None def output ( self , * a , ** kw ) : pass assert_raises ( ValueError , register_filter , MyFilter ) MyFilter . name = 'foo' register_filter ( MyFilter ) class OverrideMyFilter ( Filter , ) : name = 'foo' def output ( self , * a , ** kw ) : pass register_filter ( OverrideMyFilter ) assert_true ( isinstance ( get_filter ( 'foo' ) , OverrideMyFilter ) )
test registration of custom filters .