def test_rule_012(self): oRule = port.rule_012() self.assertTrue(oRule) self.assertEqual(oRule.name, 'port') self.assertEqual(oRule.identifier, '012') dExpected = utils.add_violation_list([43, 58, 75]) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_012(self): oRule = port.rule_012() oRule.fixable = True oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_012(self): oRule = port.rule_012() self.assertTrue(oRule) self.assertEqual(oRule.name, 'port') self.assertEqual(oRule.identifier, '012') lExpected = [14, 15, 16, 17, 23, 24, 25, 26] oRule.analyze(self.oFile) self.assertEqual( lExpected, utils.extract_violation_lines_from_violation_object( oRule.violations))