Ejemplo n.º 1
0
 def test_translate_message_cor_resp(self):
     self.assertEqual(client.translate_message({'response': 200}),
                      {'response': 200})
Ejemplo n.º 2
0
 def test_translate_message_incor_resp_len(self):
     with self.assertRaises(ResponseCodeLenError):
         client.translate_message({'response': '5'})
Ejemplo n.º 3
0
 def test_translate_message_incor_resp(self):
     with self.assertRaises(ResponseCodeError):
         client.translate_message({'response': 700})
Ejemplo n.º 4
0
 def test_translate_message_inc_type(self):
     with self.assertRaises(TypeError):
         client.translate_message(100)
Ejemplo n.º 5
0
 def test_translate_message_not_resp(self):
     with self.assertRaises(MandatoryKeyError):
         client.translate_message({'one': 'two'})
Ejemplo n.º 6
0
 def test_create_presence_acc_DigitOnly(self):
     with self.assertRaises(DigitName):
         client.create_presence('123')
Ejemplo n.º 7
0
 def test_create_presence_acc_toolong(self):
     with self.assertRaises(UsernameToLongError):
         client.create_presence('ПетяпетяпетяПетяпетяпетяПетяпетяпетя')
Ejemplo n.º 8
0
 def test_create_presence_acc_none(self):
     with self.assertRaises(OutOfUserName):
         client.create_presence(None)
Ejemplo n.º 9
0
 def test_create_presence_acc_int(self):
     with self.assertRaises(DigitName):
         client.create_presence(200)
Ejemplo n.º 10
0
 def test_create_presence_time(self):
     self.assertTrue(
         abs(client.create_presence()['time'] - time.time()) < 0.1)
Ejemplo n.º 11
0
 def test_create_presence_param(self):
     self.assertEqual(
         client.create_presence('test_user_name')["user"]["account_name"],
         'test_user_name')
Ejemplo n.º 12
0
 def test_create_presence_non(self):
     self.assertEqual(client.create_presence()['action'], "presence")