def test_fix_rule_013(self):
     oRule = generic.rule_013()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])
     self.assertEqual(oFile.lines[140].indentLevel,
                      oFile.lines[139].indentLevel + 1)
示例#2
0
    def test_rule_013(self):
        oRule = generic.rule_013()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'generic')
        self.assertEqual(oRule.identifier, '013')

        dExpected = [utils.add_violation(139)]
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
示例#3
0
 def test_fix_rule_013(self):
     oRule = generic.rule_013()
     oRule.fix(self.oFile)
     oRule.analyze(self.oFile)
     self.assertEqual(oRule.violations, [])
     self.assertEqual(self.oFile.lines[3].line, '  generic  (')
     self.assertEqual(self.oFile.lines[4].line, '    G_GEN_1 : std_logic_vector(6 downto 0);')
     self.assertEqual(self.oFile.lines[5].line, '    G_GEN_2 : std_logic_vector(8 downto 1)')
     self.assertEqual(self.oFile.lines[3].indentLevel + 1, self.oFile.lines[4].indentLevel)
    def test_fix_rule_013(self):
        oRule = generic.rule_013()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
    def test_rule_013(self):
        oRule = generic.rule_013()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'generic')
        self.assertEqual(oRule.identifier, '013')

        lExpected = [13]

        oRule.analyze(self.oFile)
        self.assertEqual(
            lExpected,
            utils.extract_violation_lines_from_violation_object(
                oRule.violations))