def test_rule_009(self): oRule = function.rule_009() self.assertTrue(oRule) self.assertEqual(oRule.name, 'function') self.assertEqual(oRule.identifier, '009') dExpected = [4] oRule.analyze(oFileMultiple) self.assertEqual(oRule.violations, dExpected)
def test_rule_009(self): oRule = function.rule_009() self.assertTrue(oRule) self.assertEqual(oRule.name, 'function') self.assertEqual(oRule.identifier, '009') lExpected = [9] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_fix_rule_009(self): oRule = function.rule_009() self.assertTrue(oRule) dExpected = [] oRule.fix(self.oFileMultiple) oRule.analyze(self.oFileMultiple) self.assertEqual(oRule.violations, dExpected) self.assertEqual(self.oFileMultiple.lines[4].line, ' function func_1 (') self.assertEqual(self.oFileMultiple.lines[5].line, ' a : integer; b : integer;') self.assertEqual(self.oFileMultiple.lines[6].line, ' c : unsigned(3 downto 0);')
def test_fix_rule_009(self): oRule = function.rule_009() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])