本文整理汇总了Python中nxdrive.client.RemoteDocumentClient.get_children方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteDocumentClient.get_children方法的具体用法?Python RemoteDocumentClient.get_children怎么用?Python RemoteDocumentClient.get_children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nxdrive.client.RemoteDocumentClient
的用法示例。
在下文中一共展示了RemoteDocumentClient.get_children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UnitTestCase
# 需要导入模块: from nxdrive.client import RemoteDocumentClient [as 别名]
# 或者: from nxdrive.client.RemoteDocumentClient import get_children [as 别名]
class UnitTestCase(unittest.TestCase):
def setUpServer(self, server_profile=None):
# Long timeout for the root client that is responsible for the test
# environment set: this client is doing the first query on the Nuxeo
# server and might need to wait for a long time without failing for
# Nuxeo to finish initialize the repo on the first request after
# startup
self.root_remote_client = RemoteDocumentClient(
self.nuxeo_url, self.admin_user,
u'nxdrive-test-administrator-device', self.version,
password=self.password, base_folder=u'/', timeout=60)
# Activate given profile if needed, eg. permission hierarchy
if server_profile is not None:
self.root_remote_client.activate_profile(server_profile)
# Call the Nuxeo operation to setup the integration test environment
credentials = self.root_remote_client.execute(
"NuxeoDrive.SetupIntegrationTests",
userNames="user_1, user_2", permission='ReadWrite')
credentials = [c.strip().split(u":") for c in credentials.split(u",")]
self.user_1, self.password_1 = credentials[0]
self.user_2, self.password_2 = credentials[1]
ws_info = self.root_remote_client.fetch(u'/default-domain/workspaces/')
children = self.root_remote_client.get_children(ws_info['uid'])
log.debug("SuperWorkspace info: %r", ws_info)
log.debug("SuperWorkspace children: %r", children)
ws_info = self.root_remote_client.fetch(TEST_WORKSPACE_PATH)
log.debug("Workspace info: %r", ws_info)
self.workspace = ws_info[u'uid']
self.workspace_title = ws_info[u'title']
self.workspace_1 = self.workspace
self.workspace_2 = self.workspace
self.workspace_title_1 = self.workspace_title
self.workspace_title_2 = self.workspace_title
def tearDownServer(self, server_profile=None):
# Don't need to revoke tokens for the file system remote clients
# since they use the same users as the remote document clients
self.root_remote_client.execute("NuxeoDrive.TearDownIntegrationTests")
# Deactivate given profile if needed, eg. permission hierarchy
if server_profile is not None:
self.root_remote_client.deactivate_profile(server_profile)
def get_local_client(self, path):
if AbstractOSIntegration.is_windows():
from nxdrive.tests.win_local_client import WindowsLocalClient
return WindowsLocalClient(path)
if AbstractOSIntegration.is_mac():
from nxdrive.tests.mac_local_client import MacLocalClient
return MacLocalClient(path)
return LocalClient(path)
def setUpApp(self, server_profile=None):
# Check the Nuxeo server test environment
self.nuxeo_url = os.environ.get('NXDRIVE_TEST_NUXEO_URL')
self.admin_user = os.environ.get('NXDRIVE_TEST_USER')
self.password = os.environ.get('NXDRIVE_TEST_PASSWORD')
self.build_workspace = os.environ.get('WORKSPACE')
self.result = None
self.tearedDown = False
# Take default parameter if none has been set
if self.nuxeo_url is None:
self.nuxeo_url = "http://localhost:8080/nuxeo"
if self.admin_user is None:
self.admin_user = "Administrator"
if self.password is None:
self.password = "Administrator"
self.tmpdir = None
if self.build_workspace is not None:
self.tmpdir = os.path.join(self.build_workspace, "tmp")
if not os.path.isdir(self.tmpdir):
os.makedirs(self.tmpdir)
self.upload_tmp_dir = tempfile.mkdtemp(u'-nxdrive-uploads', dir=self.tmpdir)
if None in (self.nuxeo_url, self.admin_user, self.password):
raise unittest.SkipTest(
"No integration server configuration found in environment.")
# Check the local filesystem test environment
self.local_test_folder_1 = tempfile.mkdtemp(u'drive-1', dir=self.tmpdir)
self.local_test_folder_2 = tempfile.mkdtemp(u'drive-2', dir=self.tmpdir)
self.local_nxdrive_folder_1 = os.path.join(
self.local_test_folder_1, u'Nuxeo Drive')
os.mkdir(self.local_nxdrive_folder_1)
self.local_nxdrive_folder_2 = os.path.join(
self.local_test_folder_2, u'Nuxeo Drive')
os.mkdir(self.local_nxdrive_folder_2)
self.nxdrive_conf_folder_1 = os.path.join(
self.local_test_folder_1, u'nuxeo-drive-conf')
os.mkdir(self.nxdrive_conf_folder_1)
self.nxdrive_conf_folder_2 = os.path.join(
self.local_test_folder_2, u'nuxeo-drive-conf')
os.mkdir(self.nxdrive_conf_folder_2)
#.........这里部分代码省略.........