def test_rule_008(self): oRule = function.rule_008() self.assertTrue(oRule) self.assertEqual(oRule.name, 'function') self.assertEqual(oRule.identifier, '008') dExpected = [5, 6, 7] oRule.analyze(oFileMultiple) self.assertEqual(oRule.violations, dExpected)
def test_rule_008(self): oRule = function.rule_008() self.assertTrue(oRule) self.assertEqual(oRule.name, 'function') self.assertEqual(oRule.identifier, '008') lExpected = [15, 16, 17, 18, 19] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_fix_rule_008(self): oRule = function.rule_008() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_fix_rule_008(self): oRule = function.rule_008() self.assertTrue(oRule) dExpected = [] oRule.fix(self.oFileMultiple) oRule.analyze(self.oFileMultiple) self.assertEqual(oRule.violations, dExpected) self.assertEqual(self.oFileMultiple.lines[5].line, ' c : unsigned(3 downto 0);') self.assertFalse(self.oFileMultiple.lines[6].isSignal) self.assertEqual(self.oFileMultiple.lines[6].line, ' signal d : std_logic_vector(7 downto 0);') self.assertFalse(self.oFileMultiple.lines[7].isConstant) self.assertEqual(self.oFileMultiple.lines[7].line, ' constant e : std_logic) return integer is')