def test_rule_005(self): oRule = library.rule_005() self.assertTrue(oRule) self.assertEqual(oRule.name, 'library') self.assertEqual(oRule.identifier, '005') dExpected = [26,27,30] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_005_upper(self): oRule = library.rule_005() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'library') self.assertEqual(oRule.identifier, '005') lExpected = [3] oRule.analyze(self.oFile) self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
def test_rule_005(self): oRule = library.rule_005() self.assertTrue(oRule) self.assertEqual(oRule.name, 'library') self.assertEqual(oRule.identifier, '005') lExpected = [{'lines':[{'number': 26}], 'words_to_fix': {'USE'}}, {'lines':[{'number': 27}], 'words_to_fix': {'Use'}}, {'lines':[{'number': 30}], 'words_to_fix': {'uSe'}}] oRule.analyze(oFile) self.assertEqual(oRule.violations, lExpected)
def test_fix_rule_005_lower(self): oRule = library.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_fix_rule_005(self): oRule = library.rule_005() oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, [])