def test_rule_015(self):
        oRule = instantiation.rule_015()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '015')

        dExpected = ['33-36', '44-46', '54-56']
        oRule.analyze(oFileGeneric)
        self.assertEqual(oRule.violations, dExpected)
Example #2
0
 def test_fix_rule_015(self):
     oRule = instantiation.rule_015()
     oRule.fix(self.oFileGeneric)
     oRule.analyze(self.oFileGeneric)
     self.assertEqual(oRule.violations, [])
     self.assertEqual(self.oFileGeneric.lines[34].line, '      GENerIC_1   => generic_1,')
     self.assertEqual(self.oFileGeneric.lines[35].line, '      GENERIC_2   => generic_2')
     self.assertEqual(self.oFileGeneric.lines[45].line, '       GENERIC_1 => generic_1,')
     self.assertEqual(self.oFileGeneric.lines[46].line, '     GENERic_2   => generic_2)')
Example #3
0
 def test_fix_rule_015(self):
     oRule = instantiation.rule_015()
     oRule.fix(oFileGeneric)
     oRule.analyze(oFileGeneric)
     self.assertEqual(oRule.violations, [])