Ejemplo n.º 1
0
    def test_to_xml(self):
        root = TemplateNode()
        node = TemplateNormalizeNode()
        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><normalize>Test</normalize></template>", xml_str)
Ejemplo n.º 2
0
    def test_to_xml(self):
        root = TemplateNode()
        node = TemplateNormalizeNode()
        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><normalize>Test</normalize></template>",
                         xml_str)
Ejemplo n.º 3
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        node = TemplateNormalizeNode()
        self.assertIsNotNone(node)

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

        node.append(TemplateWordNode("shouldnt"))
        self._bot.brain.normals.process_splits(["shouldnt", "should not"])

        self.assertEqual(root.resolve(self._bot, self._clientid), "should not")
Ejemplo n.º 4
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        node = TemplateNormalizeNode()
        self.assertIsNotNone(node)

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

        node.append(TemplateWordNode("shouldnt"))
        self._client_context.brain.normals.process_splits(["shouldnt","should not"])

        self.assertEqual(root.resolve(self._client_context), "should not")
Ejemplo n.º 5
0
    def test_node(self):
        root = TemplateNode()
        self.assertIsNotNone(root)
        self.assertIsNotNone(root.children)
        self.assertEqual(len(root.children), 0)

        node = TemplateNormalizeNode()
        self.assertIsNotNone(node)

        root.append(node)
        self.assertEqual(len(root.children), 1)
Ejemplo n.º 6
0
 def __init__(self):
     TemplateNormalizeNode.__init__(self)
Ejemplo n.º 7
0
 def __init__(self):
     TemplateNormalizeNode.__init__(self)