def test_rule_009(self): oRule = architecture.rule_009() self.assertTrue(oRule) self.assertEqual(oRule.name, 'architecture') self.assertEqual(oRule.identifier, '009') dExpected = [7, 13, 24, 31] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_009(self): oRule = architecture.rule_009() self.assertTrue(oRule) self.assertEqual(oRule.name, 'architecture') self.assertEqual(oRule.identifier, '009') dExpected = [{'lines':[{'number': 7}], 'words_to_fix': {'End'}}, {'lines':[{'number': 13}], 'words_to_fix': {'Architecture'}}, {'lines':[{'number': 24}], 'words_to_fix': {'eND'}}, {'lines':[{'number': 31}], 'words_to_fix': {'archITecture'}}] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_009_lower(self): oRule = architecture.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_upper(self): oRule = architecture.rule_009() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'architecture') self.assertEqual(oRule.identifier, '009') lExpected = [4, 12] oRule.analyze(self.oFile) self.assertEqual( utils.extract_violation_lines_from_violation_object( oRule.violations), lExpected)
def test_fix_rule_009(self): oRule = architecture.rule_009() dExpected = [] oRule.fix(self.oFile) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, dExpected)