def test_rule_020(self): oRule = if_statement.rule_020() self.assertTrue(oRule) self.assertEqual(oRule.name, 'if') self.assertEqual(oRule.identifier, '020') dExpected = [105, 110] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_020(self): lFile = utils.read_vhdlfile(os.path.join(os.path.dirname(__file__),'..','if_statement','if_test_input.vhd')) oFile = vhdlFile.vhdlFile(lFile) oRule = if_statement.rule_020() dExpected = [] oRule.fix(oFile) oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_020(self): oRule = if_statement.rule_020() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_020(self): oRule = if_statement.rule_020() self.assertTrue(oRule) self.assertEqual(oRule.name, 'if') self.assertEqual(oRule.identifier, '020') lExpected = [35, 35] oRule.analyze(self.oFile) self.assertEqual( lExpected, utils.extract_violation_lines_from_violation_object( oRule.violations))