Exemplo n.º 1
0
 def test_rule_017(self):
     oRule = process.rule_017()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '017')
     dExpected = [46]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 2
0
 def test_rule_017(self):
     oRule = process.rule_017()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '017')
     dExpected = [{'line_number': 46, 'words_to_fix': {'proc_name'}}]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 3
0
    def test_rule_017_upper(self):
        oRule = process.rule_017()
        oRule.case = 'upper'
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'process')
        self.assertEqual(oRule.identifier, '017')

        lExpected = [13]
        oRule.analyze(self.oFile)
        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
Exemplo n.º 4
0
    def test_fix_rule_017_lower(self):
        oRule = process.rule_017()

        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_017(self):
     oRule = process.rule_017()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'process')
     self.assertEqual(oRule.identifier, '017')
     lExpected = [{
         'lines': [{
             'number': 63
         }],
         'words_to_fix': {'END_PROC_NAME'}
     }, {
         'lines': [{
             'number': 68
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 75
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 81
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 88
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 97
         }],
         'words_to_fix': {'PROC_NAME'}
     }, {
         'lines': [{
             'number': 116
         }],
         'words_to_fix': {'MAIN'}
     }, {
         'lines': [{
             'number': 140
         }],
         'words_to_fix': {'TEST_PROCESS'}
     }, {
         'lines': [{
             'number': 152
         }],
         'words_to_fix': {'TEST'}
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, lExpected)
Exemplo n.º 6
0
 def test_fix_rule_017(self):
     oRule = process.rule_017()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)