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

        dExpected = [31,37,52]
        oRule.analyze(oFilePort)
        self.assertEqual(oRule.violations, dExpected)
    def test_rule_006(self):
        oRule = instantiation.rule_006()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '006')

        dExpected = [{
            'line_number': 31,
            'words_to_fix': {'pOrt'}
        }, {
            'line_number': 37,
            'words_to_fix': {'mAp'}
        }, {
            'line_number': 52,
            'words_to_fix': {'mAp'}
        }]
        oRule.analyze(oFilePort)
        self.assertEqual(oRule.violations, dExpected)
Esempio n. 3
0
 def test_fix_rule_006(self):
     oRule = instantiation.rule_006()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])
Esempio n. 4
0
 def test_rule_006(self):
     oRule = instantiation.rule_006()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'instantiation')
     self.assertEqual(oRule.identifier, '006')
     self.assertTrue(oRule.depricated)