def test_rule_032(self):
        oRule = instantiation.rule_032()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '032')
        self.assertTrue(oRule.disable)

        dExpected = utils.add_violation_list([41, 48])
        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, dExpected)
예제 #2
0
    def test_fix_rule_032(self):
        oRule = instantiation.rule_032()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
    def test_fix_rule_032(self):
        oRule = instantiation.rule_032()
        oRule.fix(self.oFile)
        oRule.analyze(self.oFile)
        self.assertEqual(self.oFile.lines[34].line,
                         '  U_INST1 : component INST1')
        self.assertEqual(self.oFile.lines[41].line,
                         '  U_INST1 : component INST1')
        self.assertEqual(self.oFile.lines[48].line,
                         '  U_INST1 : component INST1')

        self.assertEqual(oRule.violations, [])
예제 #4
0
    def test_rule_032(self):
        oRule = instantiation.rule_032()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '032')

        lExpected = [20, 27]

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