def test_rule_017_with_seperate_generic(self): oRule = entity.rule_017() self.assertTrue(oRule) self.assertEqual(oRule.name, 'entity') self.assertEqual(oRule.identifier, '017') lExpected = [19, 20, 21, 24, 25, 26] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_rule_017_with_combined_generic(self): oRule = entity.rule_017() oRule.separate_generic_port_alignment = False self.assertTrue(oRule) self.assertEqual(oRule.name, 'entity') self.assertEqual(oRule.identifier, '017') lExpected = [10, 11, 12, 19, 20, 21, 25, 26] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_rule_017(self): oRule = entity.rule_017() self.assertTrue(oRule) self.assertEqual(oRule.name, 'entity') self.assertEqual(oRule.identifier, '017') dExpected = [ '8-15', '25-31', '39-46', '56-62', '70-77', '86-90', '98-102', '118-122', '128-132' ] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_017_with_seperate_generic(self): oRule = entity.rule_017() oRule.fix(self.oFile) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTestDir, 'rule_017_test_input.fixed_seperate_generic.vhd'), lExpected) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_fix_rule_017(self): oRule = entity.rule_017() oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, [])
def test_rule_017(self): oRule = entity.rule_017() self.assertTrue(oRule) self.assertEqual(oRule.name, 'entity') self.assertEqual(oRule.identifier, '017') dExpected = [{ 'lines': [{ 'number': 9, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 10, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 11, 'keyword_column': 13, 'before_keyword_column': 11 }, { 'number': 12, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 13, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 14, 'keyword_column': 10, 'before_keyword_column': 8 }], 'max_keyword_column': 13, 'max_before_keyword_column': 11 }, { 'lines': [{ 'number': 21, 'keyword_column': 18, 'before_keyword_column': 16 }, { 'number': 22, 'keyword_column': 15, 'before_keyword_column': 13 }], 'max_keyword_column': 18, 'max_before_keyword_column': 16 }, { 'lines': [{ 'number': 26, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 27, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 28, 'keyword_column': 13, 'before_keyword_column': 11 }, { 'number': 29, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 30, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 31, 'keyword_column': 10, 'before_keyword_column': 8 }], 'max_keyword_column': 13, 'max_before_keyword_column': 11 }, { 'lines': [{ 'number': 40, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 41, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 42, 'keyword_column': 13, 'before_keyword_column': 11 }, { 'number': 43, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 44, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 45, 'keyword_column': 11, 'before_keyword_column': 9 }], 'max_keyword_column': 13, 'max_before_keyword_column': 11 }, { 'lines': [{ 'number': 52, 'keyword_column': 15, 'before_keyword_column': 13 }, { 'number': 53, 'keyword_column': 13, 'before_keyword_column': 11 }], 'max_keyword_column': 15, 'max_before_keyword_column': 13 }, { 'lines': [{ 'number': 57, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 58, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 59, 'keyword_column': 9, 'before_keyword_column': 7 }, { 'number': 60, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 61, 'keyword_column': 14, 'before_keyword_column': 12 }, { 'number': 62, 'keyword_column': 10, 'before_keyword_column': 8 }], 'max_keyword_column': 14, 'max_before_keyword_column': 12 }, { 'lines': [{ 'number': 67, 'keyword_column': 15, 'before_keyword_column': 13 }, { 'number': 68, 'keyword_column': 14, 'before_keyword_column': 12 }], 'max_keyword_column': 15, 'max_before_keyword_column': 13 }, { 'lines': [{ 'number': 71, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 72, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 73, 'keyword_column': 13, 'before_keyword_column': 11 }, { 'number': 74, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 75, 'keyword_column': 10, 'before_keyword_column': 8 }, { 'number': 76, 'keyword_column': 10, 'before_keyword_column': 8 }], 'max_keyword_column': 13, 'max_before_keyword_column': 11 }, { 'lines': [{ 'number': 83, 'keyword_column': 17, 'before_keyword_column': 15 }, { 'number': 84, 'keyword_column': 15, 'before_keyword_column': 13 }], 'max_keyword_column': 17, 'max_before_keyword_column': 15 }, { 'lines': [{ 'number': 87, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 88, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 89, 'keyword_column': 13, 'before_keyword_column': 11 }], 'max_keyword_column': 13, 'max_before_keyword_column': 11 }, { 'lines': [{ 'number': 97, 'keyword_column': 15, 'before_keyword_column': 13 }, { 'number': 99, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 100, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 101, 'keyword_column': 13, 'before_keyword_column': 11 }], 'max_keyword_column': 15, 'max_before_keyword_column': 13 }, { 'lines': [{ 'number': 119, 'keyword_column': 21, 'before_keyword_column': 19 }, { 'number': 120, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 121, 'keyword_column': 23, 'before_keyword_column': 21 }], 'max_keyword_column': 23, 'max_before_keyword_column': 21 }, { 'lines': [{ 'number': 129, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 130, 'keyword_column': 12, 'before_keyword_column': 10 }, { 'number': 131, 'keyword_column': 13, 'before_keyword_column': 11 }], 'max_keyword_column': 13, 'max_before_keyword_column': 11 }] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)