def test_rule_004_lower(self):
        oRule = process.rule_004()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '004')

        lExpected = [14]

        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
Exemple #2
0
 def test_rule_004(self):
     oRule = process.rule_004()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '004')
     dExpected = [{
         'line_number': 20,
         'words_to_fix': {'begIN'}
     }, {
         'line_number': 28,
         'words_to_fix': {'beGIn'}
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
    def test_rule_004(self):
        oRule = process.rule_004()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '004')
        lExpected = []
        dViolation = utils.add_violation(20)
        dViolation['words_to_fix'] = {'begIN'}
        lExpected.append(dViolation)

        dViolation = utils.add_violation(28)
        dViolation['words_to_fix'] = {'beGIn'}
        lExpected.append(dViolation)

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
Exemple #4
0
 def test_fix_rule_004(self):
     oRule = process.rule_004()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)