コード例 #1
0
 def test_rule_007_case(self):
     oRule = comment.rule_007()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'comment')
     self.assertEqual(oRule.identifier, '007')
     dExpected = [23, 24, 25, 29]
     oRule.analyze(oFileCase)
     self.assertEqual(oRule.violations, dExpected)
コード例 #2
0
 def test_rule_007(self):
     oRule = comment.rule_007()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'comment')
     self.assertEqual(oRule.identifier, '007')
     dExpected = [3, 7, 12, 13, 17, 19, 21, 23, 27, 30, 45, 49, 64, 68]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
コード例 #3
0
    def test_rule_005(self):
        oRule = comment.rule_005()
        dExpected = []
        oRule.fix(oFileCase)
        oRuleIndex = comment.rule_007()
        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')
コード例 #4
0
 def test_rule_007(self):
     oRule = comment.rule_007()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])