Beispiel #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)
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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)
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()