def test_bot_with_conversation(self): test_brain = TestBrain(BrainConfiguration()) self.assertIsNotNone(test_brain) bot = Bot(test_brain, BotConfiguration()) self.assertIsNotNone(bot) self.assertFalse(bot.has_conversation("testid")) response = bot.ask_question("testid", "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation("testid")) response = bot.ask_question("testid", "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation("testid")) response = bot.ask_question("testid2", "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation("testid2"))
def test_bot_with_conversation(self): test_brain = Brain(BrainConfiguration()) self.assertIsNotNone(test_brain) bot = Bot(test_brain, BotConfiguration()) self.assertIsNotNone(bot) self.assertFalse(bot.has_conversation("testid")) response = bot.ask_question("testid", "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation("testid")) response = bot.ask_question("testid", "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation("testid")) response = bot.ask_question("testid2", "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation("testid2"))
def test_bot_with_conversation(self): client = TestClient() bot = Bot(BotConfiguration(), client) self.assertIsNotNone(bot) self.assertFalse(bot.has_conversation(self._client_context)) response = bot.ask_question(self._client_context, "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation(self._client_context)) response = bot.ask_question(self._client_context, "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation(self._client_context)) client_context2 = ClientContext(TestClient(), "testid2") client_context2._bot = bot client_context2._brain = self._client_context.bot.brain response = bot.ask_question(client_context2, "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation(client_context2))
def test_bot_with_conversation(self): bot = Bot(BotConfiguration()) self.assertIsNotNone(bot) self.assertFalse(bot.has_conversation(self._client_context)) response = bot.ask_question(self._client_context, "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation(self._client_context)) response = bot.ask_question(self._client_context, "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation(self._client_context)) client_context2 = ClientContext(TestClient(), "testid2") client_context2._bot = bot client_context2._brain = self._client_context.bot.brain response = bot.ask_question(client_context2, "hello") self.assertIsNotNone(response) self.assertTrue(bot.has_conversation(client_context2))