Beispiel #1
0
 def test_rule_008(self):
     oRule = process.rule_008()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '008')
     dExpected = [15, 36]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Beispiel #2
0
    def test_fix_rule_008_lower(self):
        oRule = process.rule_008()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Beispiel #3
0
    def test_rule_008_upper(self):
        oRule = process.rule_008()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '008')

        lExpected = [9]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
Beispiel #4
0
 def test_rule_008(self):
     oRule = process.rule_008()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '008')
     dExpected = [{
         'line_number': 15,
         'words_to_fix': {'eNd'}
     }, {
         'line_number': 36,
         'words_to_fix': {'End'}
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
    def test_rule_008(self):
        oRule = process.rule_008()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '008')
        lExpected = []
        dViolation = utils.add_violation(15)
        dViolation['words_to_fix'] = {'eNd'}
        lExpected.append(dViolation)

        dViolation = utils.add_violation(36)
        dViolation['words_to_fix'] = {'End'}
        lExpected.append(dViolation)

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
Beispiel #6
0
 def test_fix_rule_008(self):
     oRule = process.rule_008()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)