def test_parse_text_multiple_words_whitespaces(self): graph = PatternGraph(self._client_context.brain.aiml_parser) root = PatternRootNode() final_node = graph._parse_text("HELLO \t\n\r THERE", root) self.assertIsNotNone(final_node) self.assertIsInstance(final_node, PatternWordNode) self.assertEqual(final_node.word, "THERE")
def test_parse_text_word(self): graph = PatternGraph(self._client_context.brain.aiml_parser) root = PatternRootNode() final_node = graph._parse_text("HELLO", root) self.assertIsNotNone(final_node) self.assertIsInstance(final_node, PatternWordNode) self.assertEqual(final_node.word, "HELLO")