Example #1
0
 def test_fix_fule_027(self):
     oRule = instantiation.rule_027()
     oRule.fix(oFileDirect)
     oRule.analyze(oFileDirect)
     self.assertEqual(oRule.violations, [])
     self.assertEqual(oFileDirect.lines[13].line,
                      '  U_INST1 : entity library.INST1')
     self.assertEqual(oFileDirect.lines[13].line,
                      '  U_INST1 : entity library.INST1')
Example #2
0
    def test_rule_027(self):
        oRule = instantiation.rule_027()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '027')

        dExpected = [13,20]
        oRule.analyze(oFileDirect)
        self.assertEqual(oRule.violations, dExpected)
Example #3
0
    def test_fix_rule_027_lower(self):
        oRule = instantiation.rule_027()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Example #4
0
    def test_rule_027_upper(self):
        oRule = instantiation.rule_027()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '027')

        lExpected = [20]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
    def test_rule_027(self):
        oRule = instantiation.rule_027()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '027')

        dExpected = [{
            'line_number': 13,
            'words_to_fix': {'ENTITY'}
        }, {
            'line_number': 20,
            'words_to_fix': {'ENTITY'}
        }]
        oRule.analyze(oFileDirect)
        self.assertEqual(oRule.violations, dExpected)