示例#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'")