def test_fix_rule_028(self):
     oRule = if_statement.rule_028()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
     self.assertEqual(oFile.lines[17].line, '    end if;')
 def test_rule_028(self):
     oRule = if_statement.rule_028()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'if')
     self.assertEqual(oRule.identifier, '028')
     dExpected = [17, 27]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
 def test_rule_028(self):
     oRule = if_statement.rule_028()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'if')
     self.assertEqual(oRule.identifier, '028')
     dExpected = [{'lines': [{'number': 17}], 'words_to_fix': {'END'}}]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Beispiel #4
0
    def test_fix_rule_028_lower(self):
        oRule = if_statement.rule_028()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Beispiel #5
0
    def test_rule_028_upper(self):
        oRule = if_statement.rule_028()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'if')
        self.assertEqual(oRule.identifier, '028')

        lExpected = [21, 22]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)