def test_node(self): root = TemplateNode() node = TemplateDeleteTripleNode(TemplateWordNode("S"), TemplateWordNode("P"), TemplateWordNode("O")) root.append(node) result = root.resolve(self._client_context) self.assertIsNotNone(result) self.assertEquals("", result)
def test_node(self): root = TemplateNode() node = TemplateDeleteTripleNode(RDFEntity(subject=TemplateWordNode("S"), predicate=TemplateWordNode("P"), object=TemplateWordNode("O"))) root.append(node) result = root.resolve(self.bot, self.clientid) self.assertIsNotNone(result) self.assertEquals("", result)
def test_to_xml(self): root = TemplateNode() node = TemplateDeleteTripleNode(RDFEntity(subject=TemplateWordNode("S"), predicate=TemplateWordNode("P"), object=TemplateWordNode("O"))) root.append(node) xml = root.xml_tree(self.bot, self.clientid) self.assertIsNotNone(xml) xml_str = ET.tostring(xml, "utf-8").decode("utf-8") self.assertEqual("<template><deletetriple><subj>S</subj><pred>P</pred><obj>O</obj></deletetriple></template>", xml_str)
def test_to_string(self): root = TemplateDeleteTripleNode() self.assertIsNotNone(root) self.assertEquals("DELETETRIPLE", root.to_string())
def __init__(self, entity=None): TemplateDeleteTripleNode.__init__(self, entity)
def __init__(self, subj, pred, obj): TemplateDeleteTripleNode.__init__(self, subj, pred, obj)