def test_rule_009_upper(self): oRule = procedure.rule_009() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'procedure') self.assertEqual(oRule.identifier, '009') lExpected = [10] oRule.analyze(self.oFile) self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
def test_fix_rule_009_lower(self): oRule = procedure.rule_009() 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_009(self): oRule = procedure.rule_009() self.assertTrue(oRule) self.assertEqual(oRule.name, 'procedure') self.assertEqual(oRule.identifier, '009') dExpected = [{ 'lines': [{ 'number': 28 }], 'words_to_fix': {'PROCEDURE'} }] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_009(self): oRule = procedure.rule_009() dExpected = [] oRule.fix(self.oFile) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, dExpected)