def test_rule_024(self):
     oRule = architecture.rule_024()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'architecture')
     self.assertEqual(oRule.identifier, '024')
     dExpected = [13, 77]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
 def test_fix_rule_024(self):
     oRule = architecture.rule_024()
     dExpected = []
     oRule.fix(self.oFile)
     oRule.analyze(self.oFile)
     self.assertEqual(self.oFile.lines[13].line, 'end Architecture ARCH;')
     self.assertEqual(self.oFile.lines[77].line, 'end ARCH;')
     self.assertEqual(oRule.violations, dExpected)
Esempio n. 3
0
    def test_rule_024_remove(self):
        oRule = architecture.rule_024()
        oRule.action = 'remove'

        lExpected = [3, 22]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
Esempio n. 4
0
    def test_rule_024_add(self):
        oRule = architecture.rule_024()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'architecture')
        self.assertEqual(oRule.identifier, '024')

        lExpected = [2, 4, 11]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
Esempio n. 5
0
    def test_fix_rule_024_add(self):
        oRule = architecture.rule_024()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected_add, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
 def test_rule_024(self):
     oRule = architecture.rule_024()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'architecture')
     self.assertEqual(oRule.identifier, '024')
     dExpected = [{
         'label': 'ARCH',
         'lineNumber': 13
     }, {
         'label': 'ARCH',
         'lineNumber': 77
     }]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
    def test_rule_024(self):
        oRule = architecture.rule_024()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'architecture')
        self.assertEqual(oRule.identifier, '024')
        lExpected = []
        dViolation = utils.add_violation(13)
        dViolation['label'] = 'ARCH'
        lExpected.append(dViolation)

        dViolation = utils.add_violation(77)
        dViolation['label'] = 'ARCH'
        lExpected.append(dViolation)

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
 def test_fix_rule_024(self):
     oRule = architecture.rule_024()
     dExpected = [13,71]
     oRule.fix(oFile)
     oRule.analyze(oFileRule010)
     self.assertEqual(oRule.violations, dExpected)