def test_rule_010(self): oRule = architecture.rule_010() self.assertTrue(oRule) self.assertEqual(oRule.name, 'architecture') self.assertEqual(oRule.identifier, '010') dExpected = [55, 77] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_010_remove(self): oRule = architecture.rule_010() oRule.action = 'remove' lExpected = [4] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_rule_010_add(self): oRule = architecture.rule_010() self.assertTrue(oRule) self.assertEqual(oRule.name, 'architecture') self.assertEqual(oRule.identifier, '010') lExpected = [8] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
def test_fix_rule_010_add(self): oRule = architecture.rule_010() 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_architecture_end(self): oRule = architecture.rule_010() dExpected = [] oRule.analyze(oFileEnd) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_010(self): oRule = architecture.rule_010() dExpected = [] oRule.fix(oFileRule010) oRule.analyze(oFileRule010) self.assertEqual(oRule.violations, dExpected)