def test_fix_rule_026(self): oRule = if_statement.rule_026() dExpected = [] oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected) self.assertEqual(oFile.lines[24].line, ' elsif ( z = 45 and f = 45 ) then')
def test_rule_026(self): oRule = if_statement.rule_026() self.assertTrue(oRule) self.assertEqual(oRule.name, 'if') self.assertEqual(oRule.identifier, '026') dExpected = [24] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_026(self): oRule = if_statement.rule_026() self.assertTrue(oRule) self.assertEqual(oRule.name, 'if') self.assertEqual(oRule.identifier, '026') dExpected = [{'lines': [{'number': 24}], 'words_to_fix': {'ELSIF'}}] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_026_lower(self): oRule = if_statement.rule_026() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected_lower, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_026_upper(self): oRule = if_statement.rule_026() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'if') self.assertEqual(oRule.identifier, '026') lExpected = [12, 17] oRule.analyze(self.oFile) self.assertEqual( utils.extract_violation_lines_from_violation_object( oRule.violations), lExpected)