def test_rule_002_exclamation_dash_dash(self): oRule = block_comment.rule_002() oRule.comment_left = '!' lExpected = [3, 4, 5, 9, 10, 11, 15, 16, 17, 18, 46, 47, 48] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_rule_002_plus(self): oRule = block_comment.rule_002() oRule.comment_left = '+' lExpected = [3, 4, 5, 15, 16, 17, 18, 22, 23, 24, 25] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_rule_002_bar(self): oRule = block_comment.rule_002() oRule.comment_left = '|' lExpected = [3, 4, 5, 9, 10, 11, 22, 23, 24, 25, 46, 47, 48] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_rule_002_default(self): oRule = block_comment.rule_002() self.assertTrue(oRule) self.assertEqual(oRule.name, 'block_comment') self.assertEqual(oRule.identifier, '002') lExpected = [] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))