示例#1
0
 def test_auth_without_2factor(self):
     s = ImplicitSession(login=USER_LOGIN,
                         password=USER_PASSWORD,
                         app_id=APP_ID)
     yield from s.authorize()
     s.close()
     self.assertIsNotNone(s.access_token)
示例#2
0
 def test_auth_with_invalid_password(self):
     s = ImplicitSession(login=USER_LOGIN,
                         password='******',
                         app_id=APP_ID)
     with self.assertRaises(VkAuthError):
         yield from s.authorize()
     s.close()
示例#3
0
 def test_auth_with_2factor(self):
     s = ImplicitSession(login=USER_LOGIN,
                         password=USER_PASSWORD,
                         app_id=APP_ID)
     with self.assertRaises(VkTwoFactorCodeNeeded):
         yield from s.authorize()
     s.close()
示例#4
0
 def test_auth_process_captcha_without_2factor(self):
     s = ImplicitSession(login=USER_LOGIN,
                         password=USER_PASSWORD,
                         app_id=APP_ID)
     for i in range(10):
         with self.assertRaises(VkCaptchaNeeded):
             yield from s.authorize()
     s.close()
示例#5
0
 def test_auth_with_app_id(self):
     s = ImplicitSession(login='', password='', app_id=APP_ID)
     with self.assertRaises(VkAuthError):
         yield from s.authorize()
     s.close()
示例#6
0
 def test_auth_without_2factor(self):
     s = ImplicitSession(login=USER_LOGIN, password=USER_PASSWORD, app_id=APP_ID)
     yield from s.authorize()
     s.close()
     self.assertIsNotNone(s.access_token)
示例#7
0
 def test_auth_with_2factor(self):
     s = ImplicitSession(login=USER_LOGIN, password=USER_PASSWORD, app_id=APP_ID)
     with self.assertRaises(VkTwoFactorCodeNeeded):
         yield from s.authorize()
     s.close()
示例#8
0
 def test_auth_with_invalid_password(self):
     s = ImplicitSession(login=USER_LOGIN, password='******', app_id=APP_ID)
     with self.assertRaises(VkAuthError):
         yield from s.authorize()
     s.close()
示例#9
0
 def test_auth_with_app_id(self):
     s = ImplicitSession(login='', password='', app_id=APP_ID)
     with self.assertRaises(VkAuthError):
         yield from s.authorize()
     s.close()
示例#10
0
 def test_auth_process_captcha_without_2factor(self):
     s = ImplicitSession(login=USER_LOGIN, password=USER_PASSWORD, app_id=APP_ID)
     for i in range(10):
         with self.assertRaises(VkCaptchaNeeded):
             yield from s.authorize()
     s.close()