def test_rule_027(self):
     oRule = process.rule_027()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '027')
     dExpected = utils.add_violation_list([77, 84])
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 2
0
    def test_rule_027_no_blank(self):
        oRule = process.rule_027()
        oRule.style = 'no_blank_line'

        lExpected = [10, 16, 22]

        oRule.analyze(self.oFile)
        self.assertEqual(
            lExpected,
            utils.extract_violation_lines_from_violation_object(
                oRule.violations))
Exemplo n.º 3
0
    def test_fix_rule_027_no_blank(self):
        self.maxDiff = None
        oRule = process.rule_027()
        oRule.style = 'no_blank_line'

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_no_blank, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Exemplo n.º 4
0
    def test_rule_027_require_blank(self):
        oRule = process.rule_027()
        oRule.style = 'require_blank_line'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '027')

        lExpected = [29, 34, 39]

        oRule.analyze(self.oFile)
        self.assertEqual(
            lExpected,
            utils.extract_violation_lines_from_violation_object(
                oRule.violations))
Exemplo n.º 5
0
 def test_fix_rule_027(self):
     oRule = process.rule_027()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)