def test_rule_003_w_2_spaces(self): oRule = type_definition.rule_003() oRule.spaces = 2 dExpected = utils.add_violation_list( [4, 6, 11, 13, 27, 34, 36, 43, 54, 57, 69, 122, 134]) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_003(self): oRule = type_definition.rule_003() dExpected = [] oRule.fix(self.oFile) oRule.analyze(self.oFile) self.assertEqual(self.oFile.lines[29].line, ' type a is (B, C,') self.assertEqual(oRule.violations, dExpected)
def test_rule_003(self): oRule = type_definition.rule_003() self.assertTrue(oRule) self.assertEqual(oRule.name, 'type') self.assertEqual(oRule.identifier, '003') dExpected = [utils.add_violation(29)] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_003_w_2_spaces(self): oRule = type_definition.rule_003() oRule.spaces = 2 dExpected = [] oRule.fix(self.oFile) oRule.analyze(self.oFile) self.assertEqual(self.oFile.lines[29].line, ' type a is (B, C,') self.assertEqual(self.oFile.lines[43].line, ' type a is (') self.assertEqual( self.oFile.lines[134].line, ' type memory_type_is_name is array (DEPTH - 1 downto 0) of STD_LOGIC_VECTOR(WIDTH-1 downto 0);' ) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_003(self): oRule = type_definition.rule_003() dExpected = [] oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_003(self): oRule = type_definition.rule_003() self.assertTrue(oRule) self.assertEqual(oRule.name, 'type') self.assertEqual(oRule.identifier, '003') self.assertTrue(oRule.depricated)