Exemple #1
0
 def test_greet_member(self):
     requests.get = mocked_get
     tito = botTito.BotTito()
     tito.sendToFirebase = mocked_sendToFirebase
     response = tito.greetNewMember("canaleta", "*****@*****.**", "token")
     expected = "Bienvenido {} al canal {}".format("*****@*****.**", "canaleta")
     self.assertEqual(response, expected)
Exemple #2
0
 def test_me(self):
     requests.get = mocked_get
     tito = botTito.BotTito()
     response = tito.getUserInfo("*****@*****.**")
     self.assertEqual(response, {
         "name": "juan",
         "nickname": "perez",
         "email": "*****@*****.**"
     })
Exemple #3
0
 def test_info(self):
     requests.get = mocked_get
     tito = botTito.BotTito()
     response = tito.getChannelInfo("1234", "canaleta", "321")
     self.assertEqual(
         response, {
             "name": "canaleta",
             "members": ["perdo", "juan", "adriana"],
             "messages": "128"
         })
Exemple #4
0
 def test_mute(self):
     return
     tito = botTito.BotTito()
     tito.mute(10)
     self.assertEqual(tito.isMuted(), True)
Exemple #5
0
 def test_help(self):
     tito = botTito.BotTito()
     expectedResponse = 'Available commands: help, info, mute<n>, me'
     self.assertEqual(tito.help(), expectedResponse)