#NEWLINE# def test_trailing_whitespace( self ) : #NEWLINE# #INDENT# rule = rules . BodyTrailingWhitespace ( ) #NEWLINE# violations = rule . validate ( 'a' , None ) #NEWLINE# self . assertIsNone ( violations ) #NEWLINE# expected_violation = rules . RuleViolation ( 'B2' , 'Line has trailing whitespace' , 'a ' ) #NEWLINE# violations = rule . validate ( 'a ' , None ) #NEWLINE# self . assertListEqual ( violations , [ rule ] ) #NEWLINE# expected_violation = rules . RuleViolation ( 'B2' , 'Line has trailing whitespace' , 'a\t' ) #NEWLINE# violations = rule . validate ( 'a\t' , None ) #NEWLINE# self . assertListEqual ( violations , [ expected_violation ] )