Exemplo n.º 1
0
    def test_rule_006(self):
        oRule = generic.rule_006()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'generic')
        self.assertEqual(oRule.identifier, '006')

        dExpected = utils.add_violation_list([37,52,53,68,83])
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 2
0
    def test_rule_006(self):
        oRule = generic.rule_006()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'generic')
        self.assertEqual(oRule.identifier, '006')

        lExpected = [17, 18, 19]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
 def test_fix_rule_006(self):
     oRule = generic.rule_006()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])
     self.assertEqual(oFile.lines[37].line,
                      '    G_GeneRIC2 : std_logic := \'1\'')
     self.assertEqual(oFile.lines[52].line,
                      '    G_GENERIC1 : STD_LOGIC := \'0\';')
     self.assertEqual(oFile.lines[53].line,
                      '    G_GENERIC2 : std_logic := \'1\'')
Exemplo n.º 4
0
    def test_fix_rule_006(self):
        oRule = generic.rule_006()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Exemplo n.º 5
0
    def test_component_rule_006(self):
        oRule = generic.rule_006()

        dExpected = utils.add_violation_list([36,37])
        oRule.analyze(oFileComponent)
        self.assertEqual(oRule.violations, dExpected)