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