def test_fix_rule_001(self): oRule = whitespace.rule_001() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_001(self): oRule = whitespace.rule_001() self.assertTrue(oRule) self.assertEqual(oRule.name, 'whitespace') self.assertEqual(oRule.identifier, '001') lExpected = [1, 8, 9, 10, 12] oRule.analyze(self.oFile) self.assertEqual( lExpected, utils.extract_violation_lines_from_violation_object( oRule.violations))
def test_001(self): oRule = whitespace.rule_001() self.assertTrue(oRule) self.assertEqual(oRule.name, 'whitespace') self.assertEqual(oRule.identifier, '001') self.assertEqual(oRule.phase, 2) dExpected = utils.add_violation_list([2,4]) self.oFile.lines.append(line.line(' This is a test of ending whitespace')) self.oFile.lines.append(line.line(' This is a test of ending whitespace ')) self.oFile.lines.append(line.line(' This is a test of ending whitespace')) self.oFile.lines.append(line.line(' This is a test of ending whitespace ')) self.oFile.lines.append(line.line(' This is a test of ending whitespace')) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_001(self): oRule = whitespace.rule_001() self.assertTrue(oRule) self.assertEqual(oRule.name, 'whitespace') self.assertEqual(oRule.identifier, '001') oFile = vhdlFile.vhdlFile(sFileName) dExpected = [] oFile.lines.append(line.line(' This is a test of ending whitespace')) oFile.lines.append(line.line(' This is a test of ending whitespace ')) oFile.lines.append(line.line(' This is a test of ending whitespace')) oFile.lines.append(line.line(' This is a test of ending whitespace ')) oFile.lines.append(line.line(' This is a test of ending whitespace')) oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)