Ejemplo n.º 1
0
    def test_rule_009(self):
        oRule = instantiation.rule_009()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '009')

        dExpected = [23,52]
        oRule.analyze(oFilePort)
        self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 2
0
    def test_rule_009_upper(self):
        oRule = instantiation.rule_009()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '009')

        lExpected = [20]
        oRule.analyze(self.oFile)
        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
Ejemplo n.º 3
0
    def test_fix_rule_009_lower(self):
        oRule = instantiation.rule_009()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
    def test_rule_009(self):
        oRule = instantiation.rule_009()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '009')

        dExpected = [{
            'line_number': 23,
            'words_to_fix': {'InST1'}
        }, {
            'line_number': 52,
            'words_to_fix': {'INsT1'}
        }]
        oRule.analyze(oFilePort)
        self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 5
0
 def test_fix_rule_009(self):
     oRule = instantiation.rule_009()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])