#NEWLINE# def testBasic( self ) : #NEWLINE# #INDENT# f = filters . Filter ( object ( ) , 'expecterror:=~^foo$' ) #NEWLINE# self . assertEquals ( f . filter ( errors . Failure ( errors . TestCritical ( 'foo' ) ) ) , 'Expected Error: foo' ) #NEWLINE# self . assertRaises ( errors . TestCritical , f . filter , errors . Failure ( errors . TestCritical ( 'bar' ) ) ) #NEWLINE# self . assertEquals ( f . filter ( errors . Failure ( errors . TestWarning ( 'foo' ) ) ) , 'Expected Error: foo' ) #NEWLINE# self . assertRaises ( errors . TestCritical , f . filter , errors . Failure ( errors . TestWarning ( 'bar' ) ) ) #NEWLINE# self . assertRaises ( errors . TestCritical , f . filter , 'foo' )