def test_rule_004_with_default(self): oRule = subtype.rule_004() self.assertTrue(oRule) self.assertEqual(oRule.name, 'subtype') self.assertEqual(oRule.identifier, '004') dExpected = [7, 8, 10, 11] oRule.analyze(oFilePrefix) self.assertEqual(oRule.violations, dExpected)
def test_rule_004(self): oRule = subtype.rule_004() self.assertTrue(oRule) self.assertEqual(oRule.name, 'subtype') self.assertEqual(oRule.identifier, '004') lExpected = [7, 8, 10, 11] oRule.analyze(self.oFile) self.assertEqual( lExpected, utils.extract_violation_lines_from_violation_object( oRule.violations))
def test_rule_004_with_single_override(self): oRule = subtype.rule_004() oRule.prefixes = ['subt_'] dExpected = [4, 5, 10, 11] oRule.analyze(oFilePrefix) self.assertEqual(oRule.violations, dExpected)
def test_rule_004_with_multiple_override(self): oRule = subtype.rule_004() oRule.prefixes = ['st_', 'subt_'] dExpected = utils.add_violation_list([10, 11]) oRule.analyze(oFilePrefix) self.assertEqual(oRule.violations, dExpected)