Exemplo n.º 1
0
 def test_rule_009(self):
     oRule = process.rule_009()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '009')
     dExpected = [22, 42]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 2
0
    def test_fix_rule_009_lower(self):
        oRule = process.rule_009()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Exemplo n.º 3
0
    def test_rule_009_upper(self):
        oRule = process.rule_009()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '009')

        lExpected = [9]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
Exemplo n.º 4
0
 def test_rule_009(self):
     oRule = process.rule_009()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '009')
     dExpected = [{
         'line_number': 22,
         'words_to_fix': {'proCEss'}
     }, {
         'line_number': 42,
         'words_to_fix': {'Process'}
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
    def test_rule_009(self):
        oRule = process.rule_009()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '009')
        lExpected = []
        dViolation = utils.add_violation(22)
        dViolation['words_to_fix'] = {'proCEss'}
        lExpected.append(dViolation)

        dViolation = utils.add_violation(42)
        dViolation['words_to_fix'] = {'Process'}
        lExpected.append(dViolation)

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
Exemplo n.º 6
0
 def test_fix_rule_009(self):
     oRule = process.rule_009()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)