def test_auth_token_free_request_without_token(self): s = TokenSession() result = yield from s.send_api_request('users.get', {'user_ids': 1}) s.close() self.assertListEqual(result, [{ 'id': 1, 'last_name': 'Дуров', 'first_name': 'Павел' }])
def test_auth_token_nonfree_request_without_token(self): s = TokenSession() with self.assertRaises(VkAuthError): yield from s.send_api_request('messages.get') s.close()
def test_auth_with_token(self): s = TokenSession(self._token) with self.assertRaises(VkAuthError): yield from s.authorize() s.close()
def test_auth_token_free_request_without_token(self): s = TokenSession() result = yield from s.send_api_request('users.get', {'user_ids': 1}) s.close() self.assertListEqual(result, [{'id': 1, 'last_name': 'Дуров', 'first_name': 'Павел'}])