コード例 #1
0
 def test_chatbot_greetingMessage(self, usern="Joshua", message="!! greeting"): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "Welcome to the chatroom of brotherhood.")
コード例 #2
0
 def test_chatbot_noMessage(self, usern="Joshua", message="!! "): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "That is not a correct command. Please try again!") 
コード例 #3
0
 def test_chatbot_whyMessage(self, usern="Joshua", message="!! say happiness"): 
     self.usern = usern
     self.message = "{}".format(message[7:])
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "happiness") 
コード例 #4
0
 def test_chatbot_whenMessage(self, usern="Joshua", message="!! when"): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "I was originally created on March 7, 2020. Fun fact: That's my birthday!") 
コード例 #5
0
 def test_chatbot_whatMessage(self, usern="Joshua", message="!! what"): 
     self.usern = usern
     self.message = "I am a chatbot. But not just any chatbot. I am the I-Phi Bot, created by Joshua Smith."
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "I am a chatbot. But not just any chatbot. I am the I-Phi Bot, created by Joshua Smith.") 
コード例 #6
0
 def test_chatbot_whoMessage(self, usern="Joshua", message="!! who"): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "My name is... I-Phi Bot!") 
コード例 #7
0
 def test_chatbot_partyMessage(self, usern="Joshua", message="!! party date"): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result,  "You already know when the party is {}, stop playing with me brother!".format(usern)) 
コード例 #8
0
 def test_chatbot_serviceMessage(self, usern="Joshua", message="!! service date"): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result,  "At this current time, the next community service date will be held on April 23, following the regional convention.")
コード例 #9
0
 def test_chatbot_helpMessage(self, usern="Joshua", message="!! help"): 
     self.usern = usern
     self.message = message
     result = chatchat.ChatBot(usern, message)[1]
     self.assertEqual(result, "The following commands are available to you: '!! greeting' | '!! help' | '!! say <something>' | '!! service date' | '!! party date' | '!! brotherhood quote'\
      | '!! who' | '!! why' | '!! what' | '!! when'")