def register_node_providers_url(self, node): httpretty.register_uri( httpretty.GET, api_node_files(node.id), body=get_providers_for_node, content_type="application/json" )
def get_node_file_folders(node_id): node_files_url = api_node_files(node_id) resp = session.get(node_files_url) assert resp.ok osf_storage_folder = RemoteFolder(resp.json()['data'][0]) assert osf_storage_folder.provider == osf_storage_folder.name children_resp = session.get(osf_storage_folder.child_files_url) assert children_resp.ok return [dict_to_remote_object(file_folder) for file_folder in children_resp.json()['data']]
def get_node_file_folders(node_id): node_files_url = api_node_files(node_id) resp = session.get(node_files_url) assert resp.ok osf_storage_folder = RemoteFolder(resp.json()['data'][0]) assert osf_storage_folder.provider == osf_storage_folder.name children_resp = session.get(osf_storage_folder.child_files_url) assert children_resp.ok return [ dict_to_remote_object(file_folder) for file_folder in children_resp.json()['data'] ]