def test_rule_017(self): oRule = generic.rule_017() self.assertTrue(oRule) self.assertEqual(oRule.name, 'generic') self.assertEqual(oRule.identifier, '017') dExpected = [52, 96] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_017(self): oRule = generic.rule_017() self.assertTrue(oRule) self.assertEqual(oRule.name, 'generic') self.assertEqual(oRule.identifier, '017') dExpected = [{'line_number': 52, 'words_to_fix': {'STD_LOGIC'}}, {'line_number': 96, 'words_to_fix': {'STD_LOGIC'}}] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_017_lower(self): oRule = generic.rule_017() 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_017_upper(self): oRule = generic.rule_017() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'generic') self.assertEqual(oRule.identifier, '017') lExpected = [5, 6, 8, 9, 10, 11] oRule.analyze(self.oFile) self.assertEqual( utils.extract_violation_lines_from_violation_object( oRule.violations), lExpected)
def test_rule_017_lower(self): oRule = generic.rule_017() self.assertTrue(oRule) self.assertEqual(oRule.name, 'generic') self.assertEqual(oRule.identifier, '017') lExpected = [23, 24, 26, 27, 28, 29] oRule.analyze(self.oFile) self.assertEqual( utils.extract_violation_lines_from_violation_object( oRule.violations), lExpected)