def test_rule_016(self): oRule = instantiation.rule_016() self.assertTrue(oRule) self.assertEqual(oRule.name, 'instantiation') self.assertEqual(oRule.identifier, '016') dExpected = [34,46,55] oRule.analyze(oFileGeneric) self.assertEqual(oRule.violations, dExpected)
def test_rule_016(self): oRule = instantiation.rule_016() self.assertTrue(oRule) self.assertEqual(oRule.name, 'instantiation') self.assertEqual(oRule.identifier, '016') dExpected = [{ 'line_number': 34, 'words_to_fix': {'GENerIC_1'} }, { 'line_number': 46, 'words_to_fix': {'GENERic_2'} }, { 'line_number': 55, 'words_to_fix': {'generic_2'} }] oRule.analyze(oFileGeneric) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_016(self): oRule = instantiation.rule_016() oRule.fix(self.oFileGeneric) oRule.analyze(self.oFileGeneric) self.assertEqual(oRule.violations, [])
def test_rule_016(self): oRule = instantiation.rule_016() self.assertTrue(oRule) self.assertEqual(oRule.name, 'instantiation') self.assertEqual(oRule.identifier, '016') self.assertTrue(oRule.depricated)