示例#1
0
 def test_rule_019(self):
     oRule = process.rule_019()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '019')
     dExpected = [48]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
示例#2
0
 def test_rule_019(self):
     oRule = process.rule_019()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '019')
     dExpected = [{'line_number': 48, 'words_to_fix': {'proc_name'}}]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
    def test_fix_rule_019_lower(self):
        oRule = process.rule_019()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_lower, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
 def test_rule_019(self):
     oRule = process.rule_019()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '019')
     lExpected = [{
         'lines': [{
             'number': 65
         }],
         'words_to_fix': {'END_PROC_NAME'}
     }, {
         'lines': [{
             'number': 72
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 79
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 86
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 94
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 103
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 123
         }],
         'words_to_fix': {'MAIN'}
     }, {
         'lines': [{
             'number': 150
         }],
         'words_to_fix': {'TEST_PROCESS'}
     }, {
         'lines': [{
             'number': 155
         }],
         'words_to_fix': {'TEST'}
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, lExpected)
    def test_rule_019_upper(self):
        oRule = process.rule_019()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '019')

        lExpected = [15]
        oRule.analyze(self.oFile)
        self.assertEqual(
            utils.extract_violation_lines_from_violation_object(
                oRule.violations), lExpected)
示例#6
0
 def test_fix_rule_019(self):
     oRule = process.rule_019()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)