def test_rule_010_case(self): oRule = comment.rule_010() self.assertTrue(oRule) self.assertEqual(oRule.name, 'comment') self.assertEqual(oRule.identifier, '010') dExpected = [23, 24, 25, 29] oRule.analyze(oFileCase) self.assertEqual(oRule.violations, dExpected)
def test_rule_010(self): oRule = comment.rule_010() self.assertTrue(oRule) self.assertEqual(oRule.name, 'comment') self.assertEqual(oRule.identifier, '010') dExpected = [3, 7, 12, 13, 17, 19, 21, 23, 27, 30, 45, 49, 64, 68] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_010(self): oRule = comment.rule_010() self.assertTrue(oRule) self.assertEqual(oRule.name, 'comment') self.assertEqual(oRule.identifier, '010') lExpected = [3, 8, 10, 11, 14, 15, 16, 26, 28, 32, 34, 64, 66, 68, 72, 74, 78, 80, 84, 86] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_fix_rule_010(self): oRule = comment.rule_010() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_005(self): oRule = comment.rule_005() dExpected = [] oRule.fix(oFileCase) oRuleIndex = comment.rule_010() oRuleIndex.fix(oFileCase) oRule.analyze(oFileCase) self.assertEqual(oRule.violations, dExpected) self.assertEqual(oFileCase.lines[23].indentLevel, 3) self.assertEqual(oFileCase.lines[24].indentLevel, 3) self.assertEqual(oFileCase.lines[25].indentLevel, 3) self.assertEqual(oFileCase.lines[23].line, ' -- Comment 1') self.assertEqual(oFileCase.lines[24].line, ' -- Comment 2') self.assertEqual(oFileCase.lines[25].line, ' -- Comment 3')
def test_rule_010(self): oRule = comment.rule_010() oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, [])