def test_create_authorization(self): client = Client() params = {'x_auth_password': '******', 'x_auth_username': '******', 'x_auth_permission': 'delete', 'x_auth_mode': 'client_auth', 'oauth_timestamp': '1428164862', 'oauth_nonce': '2826375882870'} oauth = client._create_authorization(url='https://secure.vimeo.com/oauth/access_token', method='POST', params=params) pass
def test_create_authorization(self): client = Client() params = { "x_auth_password": "******", "x_auth_username": "******", "x_auth_permission": "delete", "x_auth_mode": "client_auth", "oauth_timestamp": "1428164862", "oauth_nonce": "2826375882870", } oauth = client._create_authorization( url="https://secure.vimeo.com/oauth/access_token", method="POST", params=params ) pass
def test_create_authorization(self): client = Client() params = { 'x_auth_password': '******', 'x_auth_username': '******', 'x_auth_permission': 'delete', 'x_auth_mode': 'client_auth', 'oauth_timestamp': '1428164862', 'oauth_nonce': '2826375882870' } oauth = client._create_authorization( url='https://secure.vimeo.com/oauth/access_token', method='POST', params=params) pass
def get_client(self, context): # set the items per page (later) items_per_page = context.get_settings().get_items_per_page() access_manager = context.get_access_manager() access_token = access_manager.get_access_token() if access_manager.is_new_login_credential() or not access_token or access_manager.is_access_token_expired(): # reset access_token access_manager.update_access_token('') # we clear the cache, so none cached data of an old account will be displayed. context.get_function_cache().clear() # reset the client self._client = None pass if not self._client: if access_manager.has_login_credentials() or access_manager.has_refresh_token(): username, password = access_manager.get_login_credentials() access_token = access_manager.get_access_token() refresh_token = access_manager.get_refresh_token() # create a new access_token if not access_token and username and password: data = Client().login(username, password) access_manager.update_access_token(access_token=data.get('oauth_token'), refresh_token=data.get('oauth_token_secret')) pass access_token = access_manager.get_access_token() refresh_token = access_manager.get_refresh_token() if access_token and refresh_token: self._client = Client(oauth_token=access_token, oauth_token_secret=refresh_token) else: self._client = Client() pass self._is_logged_in = access_token != '' else: self._client = Client() pass pass return self._client
def test_search(self): client = Client() xml_data = client.search(query='batman robin') pass
def test_get_video_streams(self): client = Client() streams = client.get_video_streams(video_id='128267976') pass
def get_client(self, logged_in=False): client = Client() data = client.login(self.USERNAME, self.PASSWORD) client = Client(data['oauth_token'], data['oauth_token_secret']) return client
def test_get_video_streams(self): client = Client() streams = client.get_video_streams(video_id='68375962') pass
def test_search(self): client = Client() xml_data = client.search(query='The Breakfast Club é Extras') pass
def test_search(self): client = Client() xml_data = client.search(query="The Breakfast Club é Extras") pass