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

        dExpected = [31,45]
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
Esempio n. 2
0
    def test_fix_rule_006_lower(self):
        oRule = package.rule_006()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Esempio n. 3
0
    def test_rule_006_upper(self):
        oRule = package.rule_006()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'package')
        self.assertEqual(oRule.identifier, '006')

        lExpected = [4]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
    def test_rule_006(self):
        oRule = package.rule_006()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'package')
        self.assertEqual(oRule.identifier, '006')

        lExpected = []
        dViolation = utils.add_violation(45)
        dViolation['words_to_fix'] = {'END'}
        lExpected.append(dViolation)

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
 def test_fix_rule_006(self):
     oRule = package.rule_006()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])