From 728844a8d0dfc26f6f226e16a421d1f2bfb5a310 Mon Sep 17 00:00:00 2001 From: Gunther Cox Date: Sun, 3 Dec 2017 16:45:11 -0500 Subject: [PATCH] Test training with emoji characters. --- tests/training_tests/test_list_training.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/training_tests/test_list_training.py b/tests/training_tests/test_list_training.py index 74bd46056..900330ef7 100644 --- a/tests/training_tests/test_list_training.py +++ b/tests/training_tests/test_list_training.py @@ -115,6 +115,22 @@ def test_training_with_unicode_characters(self): self.assertEqual(response, conversation[2]) + def test_training_with_emoji_characters(self): + """ + Ensure that the training method adds statements containing emojis. + """ + conversation = [ + u'Hi, how are you? 😃', + u'I am just dandy 👍', + u'Superb! 🎆' + ] + + self.chatbot.train(conversation) + + response = self.chatbot.get_response(conversation[1]) + + self.assertEqual(response, conversation[2]) + def test_similar_sentence_gets_same_response_multiple_times(self): """ Tests if the bot returns the same response for the same