示例#1
0
    def test_to_xml(self):
        root = TemplateNode()
        node = TemplateOOBNode()
        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><oob>Test</oob></template>", xml_str)
示例#2
0
    def test_to_xml(self):
        root = TemplateNode()
        node = TemplateOOBNode()
        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><oob>Test</oob></template>", xml_str)
示例#3
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)

        oob = TemplateOOBNode()
        root.append(oob)

        oob.append(TemplateWordNode("hello"))

        self.assertEqual(len(root.children), 1)

        resolved = root.resolve(self._client_context)
        self.assertIsNotNone(resolved)
        self.assertEqual("<oob>hello</oob>", resolved)
示例#4
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)

        oob = TemplateOOBNode()
        root.append(oob)

        oob.append(TemplateWordNode("hello"))

        self.assertEqual(len(root.children), 1)

        resolved = root.resolve(self._client_context)
        self.assertIsNotNone(resolved)
        self.assertEqual("<oob>hello</oob>", resolved)