def test_set_description(self): from libcellml import Issue # void setDescription(const std::string &description) e = Issue() e.setDescription('hello') e.setDescription('')
def test_description(self): from libcellml import Issue # std::string description() d = 'hi' e = Issue() self.assertEqual(e.description(), '') e.setDescription(d) self.assertEqual(e.description(), d) del [d, e]
def test_issue_types(self): from libcellml import Parser, Issue p = Parser() i1 = Issue() i1.setLevel(Issue.Level.ERROR) i1.setDescription("error error") p.addIssue(i1) i4 = Issue() i4.setLevel(Issue.Level.WARNING) i4.setDescription("warning warning") p.addIssue(i4) i2 = Issue() i2.setLevel(Issue.Level.HINT) i2.setDescription("hint hint") p.addIssue(i2) i3 = Issue() i3.setLevel(Issue.Level.MESSAGE) i3.setDescription("message message") p.addIssue(i3) self.assertEqual(1, p.errorCount()) error = p.error(0) self.assertEqual("error error", error.description()) self.assertEqual(1, p.warningCount()) warning = p.warning(0) self.assertEqual("warning warning", warning.description()) self.assertEqual(1, p.hintCount()) hint = p.hint(0) self.assertEqual("hint hint", hint.description()) self.assertEqual(1, p.messageCount()) message = p.message(0) self.assertEqual("message message", message.description()) self.assertEqual(4, p.issueCount()) p.removeAllIssues() self.assertEqual(0, p.issueCount())