Ejemplo n.º 1
0
 def test_rule_013(self):
     oRule = process.rule_013()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '013')
     dExpected = [6, 27, 33]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 2
0
    def test_fix_rule_013_lower(self):
        oRule = process.rule_013()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Ejemplo n.º 3
0
    def test_rule_013_upper(self):
        oRule = process.rule_013()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '013')

        lExpected = [7]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
Ejemplo n.º 4
0
 def test_rule_013(self):
     oRule = process.rule_013()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '013')
     dExpected = [{
         'line_number': 6,
         'words_to_fix': {'IS'}
     }, {
         'line_number': 27,
         'words_to_fix': {'iS'}
     }, {
         'line_number': 33,
         'words_to_fix': {'Is'}
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 5
0
    def test_rule_013(self):
        oRule = process.rule_013()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '013')
        lExpected = []
        dViolation = utils.add_violation(6, )
        dViolation['words_to_fix'] = {'IS'}
        lExpected.append(dViolation)

        dViolation = utils.add_violation(27)
        dViolation['words_to_fix'] = {'iS'}
        lExpected.append(dViolation)

        dViolation = utils.add_violation(33)
        dViolation['words_to_fix'] = {'Is'}
        lExpected.append(dViolation)

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
Ejemplo n.º 6
0
 def test_fix_rule_013(self):
     oRule = process.rule_013()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)