def test_rule_005(self): oRule = process.rule_005() self.assertTrue(oRule) self.assertEqual(oRule.name, 'process') self.assertEqual(oRule.identifier, '005') dExpected = [17, 24, 32] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_005_lower(self): oRule = process.rule_005() 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_005_upper(self): oRule = process.rule_005() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'process') self.assertEqual(oRule.identifier, '005') lExpected = [7] oRule.analyze(self.oFile) self.assertEqual( utils.extract_violation_lines_from_violation_object( oRule.violations), lExpected)
def test_rule_005(self): oRule = process.rule_005() self.assertTrue(oRule) self.assertEqual(oRule.name, 'process') self.assertEqual(oRule.identifier, '005') dExpected = [{ 'line_number': 17, 'words_to_fix': {'prOCess'} }, { 'line_number': 24, 'words_to_fix': {'Process'} }, { 'line_number': 32, 'words_to_fix': {'proCEss'} }] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_005(self): oRule = process.rule_005() self.assertTrue(oRule) self.assertEqual(oRule.name, 'process') self.assertEqual(oRule.identifier, '005') lExpected = [] dViolation = utils.add_violation(17) dViolation['words_to_fix'] = {'prOCess'} lExpected.append(dViolation) dViolation = utils.add_violation(24) dViolation['words_to_fix'] = {'Process'} lExpected.append(dViolation) dViolation = utils.add_violation(32) dViolation['words_to_fix'] = {'proCEss'} lExpected.append(dViolation) oRule.analyze(oFile) self.assertEqual(oRule.violations, lExpected)
def test_fix_rule_005(self): oRule = process.rule_005() dExpected = [] oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)