Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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, [])
Exemple #4
0
    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)
Exemple #5
0
    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)