Exemplo n.º 1
0
    def test_transcripts_no_conversation(self):
        client = TranscriptAdminExtensionClient()
        client_context = client.create_client_context("testid")

        extension = TranscriptAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "")
        self.assertIsNotNone(result)
        self.assertEqual("No conversation currently available", result)
Exemplo n.º 2
0
    def test_transcripts_no_questions_without_props(self):
        client = TranscriptAdminExtensionClient()
        client_context = client.create_client_context("testid")

        client_context.bot.get_conversation(client_context)

        extension = TranscriptAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "")
        self.assertIsNotNone(result)
        self.assertEqual("Questions:<br /><ul></ul><br />", result)
Exemplo n.º 3
0
    def test_transcripts_no_questions_without_props(self):
        client = TranscriptAdminExtensionClient()
        client_context = client.create_client_context("testid")

        client_context.bot.get_conversation(client_context)

        extension = TranscriptAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "")
        self.assertIsNotNone(result)
        self.assertEquals("Questions:<br /><ul></ul><br />", result)
Exemplo n.º 4
0
    def test_transcripts_questions_with_props(self):
        client = TranscriptAdminExtensionClient()
        client_context = client.create_client_context("testid")

        question = Question.create_from_sentence(Sentence(client_context.brain.tokenizer, "Hello World"))
        conversation = client_context.bot.get_conversation(client_context)
        conversation.record_dialog(question)

        extension = TranscriptAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "PROPERTIES")
        self.assertIsNotNone(result)
        self.assertEqual("Questions:<br /><ul><li>Hello World - </li></ul><br />Properties:<br /><ul><li>topic = *</li></ul><br />", result)
Exemplo n.º 5
0
    def test_transcripts_questions_with_props(self):
        client = TranscriptAdminExtensionClient()
        client_context = client.create_client_context("testid")

        question = Question.create_from_sentence(Sentence(client_context.brain.tokenizer, "Hello World"))
        conversation = client_context.bot.get_conversation(client_context)
        conversation.record_dialog(question)

        extension = TranscriptAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "PROPERTIES")
        self.assertIsNotNone(result)
        self.assertEquals("Questions:<br /><ul><li>Hello World - </li></ul><br />Properties:<br /><ul><li>topic = *</li></ul><br />", result)