Esempio n. 1
0
    def test_to_xml(self):
        root = TemplateNode()
        node = TemplatePersonNode()
        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><person>Test</person></template>", xml_str)
Esempio n. 2
0
    def test_to_xml(self):
        root = TemplateNode()
        node = TemplatePersonNode()
        root.append(node)
        node.append(TemplateWordNode("Test"))

        xml = root.xml_tree(self._bot, self._clientid)
        self.assertIsNotNone(xml)
        xml_str = ET.tostring(xml, "utf-8").decode("utf-8")
        self.assertEqual("<template><person>Test</person></template>", xml_str)
Esempio n. 3
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        node = TemplatePersonNode()
        self.assertIsNotNone(node)

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

        node.append(TemplateWordNode("me"))
        self._bot.brain.persons.process_splits(["me", "you"])

        self.assertEqual(root.resolve(self._bot, self._clientid), "you")
Esempio n. 4
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        node = TemplatePersonNode()
        self.assertIsNotNone(node)

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

        node.append(TemplateWordNode("me"))
        self._client_context.brain.persons.process_splits(["me","you"])

        self.assertEqual(root.resolve(self._client_context), "you")
Esempio n. 5
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        node = TemplatePersonNode()
        self.assertIsNotNone(node)

        root.append(node)
        self.assertEqual(len(root.children), 1)
Esempio n. 6
0
 def __init__(self):
     TemplatePersonNode.__init__(self)
Esempio n. 7
0
 def __init__(self):
     TemplatePersonNode.__init__(self)