def test_rule_001(self): oRule = after.rule_001() self.assertTrue(oRule) self.assertEqual(oRule.name, 'after') self.assertEqual(oRule.identifier, '001') self.assertTrue(oRule.disable) self.assertEqual(oRule.magnitude, 1) self.assertEqual(oRule.units, 'ns') lExpected = utils.add_violation_list([33, 34]) oRule.analyze(oFile) self.assertEqual(oRule.violations, lExpected)
def test_fix_rule_001(self): oRule = after.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_fix_rule_001(self): oRule = after.rule_001() oRule.fix(self.oFile) self.assertEqual(self.oFile.lines[33].line, ' b <= c after 1 ns;') self.assertEqual(self.oFile.lines[34].line, ' c <= d after 1 ns;') lExpected = [] oRule.analyze(self.oFile) self.assertEqual(oRule.violations, lExpected)
def test_rule_001(self): oRule = after.rule_001() self.assertTrue(oRule) self.assertEqual(oRule.name, 'after') self.assertEqual(oRule.identifier, '001') lExpected = [74, 75, 85, 87, 97, 98, 111, 112] oRule.analyze(self.oFile) self.assertEqual( lExpected, utils.extract_violation_lines_from_violation_object( oRule.violations))