def test_to_xml(self): root = TemplateNode() node = TemplateEvalNode() root.append(node) node.append(TemplateWordNode("Test")) xml = root.xml_tree(self._client_context) self.assertIsNotNone(xml) xml_str = ET.tostring(xml, "utf-8").decode("utf-8") self.assertEqual("<template><eval>Test</eval></template>", xml_str)
def test_to_xml(self): root = TemplateNode() node = TemplateEvalNode() root.append(node) node.append(TemplateWordNode("Test")) xml = root.xml_tree(self._client_context) self.assertIsNotNone(xml) xml_str = ET.tostring(xml, "utf-8").decode("utf-8") self.assertEqual("<template><eval>Test</eval></template>", xml_str)
def test_node(self): root = TemplateNode() self.assertIsNotNone(root) eval = TemplateEvalNode() root.append(eval) eval.append(TemplateWordNode("hello")) self.assertEqual(len(root.children), 1) resolved = root.resolve(self._client_context) self.assertIsNotNone(resolved) self.assertEqual("hello", resolved)
def test_node(self): root = TemplateNode() self.assertIsNotNone(root) eval = TemplateEvalNode() root.append(eval) eval.append(TemplateWordNode("hello")) self.assertEqual(len(root.children), 1) resolved = root.resolve(self._client_context) self.assertIsNotNone(resolved) self.assertEqual("hello", resolved)