Example #1
0
    def test_list_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        list = TemplateListNode()

        list._items.append(TemplateWordNode("Item1"))
        list._items.append(TemplateWordNode("Item2"))

        root.append(list)

        resolved = root.resolve(self._client_context)

        self.assertIsNotNone(resolved)
        self.assertEqual("<list><item>Item1</item><item>Item2</item></list>", resolved)

        self.assertEqual("<list><item>Item1</item><item>Item2</item></list>", root.to_xml(self._client_context))
Example #2
0
 def __init__(self):
     TemplateListNode.__init__(self)