Esempio 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)
Esempio 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)
Esempio 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")
Esempio 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")
Esempio 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)
Esempio n. 6
0
 def __init__(self):
     TemplateNormalizeNode.__init__(self)
Esempio n. 7
0
 def __init__(self):
     TemplateNormalizeNode.__init__(self)