Ejemplo n.º 1
0
    def test_rule_020_with_override(self):
        oRule = generic.rule_020()
        oRule.prefixes = ['A_']

        dExpected = utils.add_violation_list([5,6,21,22,36,37,52,53,68,83,84,97,139,140,155,156,170,171])
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 2
0
    def test_rule_020_with_2_overrides(self):
        oRule = generic.rule_020()
        oRule.prefixes = ['G_', 'A_']

        dExpected = []
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 3
0
    def test_rule_020_with_default(self):
        oRule = generic.rule_020()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'generic')
        self.assertEqual(oRule.identifier, '020')

        dExpected = utils.add_violation_list([67,96,116])
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
Ejemplo n.º 4
0
    def test_rule_020(self):
        oRule = generic.rule_020()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'generic')
        self.assertEqual(oRule.identifier, '020')

        lExpected = [14, 15]

        oRule.analyze(self.oFile)
        self.assertEqual(
            lExpected,
            utils.extract_violation_lines_from_violation_object(
                oRule.violations))