本文整理匯總了Python中managers.model_managers.WorkspaceManager.getWorkspacesNames方法的典型用法代碼示例。如果您正苦於以下問題:Python WorkspaceManager.getWorkspacesNames方法的具體用法?Python WorkspaceManager.getWorkspacesNames怎麽用?Python WorkspaceManager.getWorkspacesNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類managers.model_managers.WorkspaceManager
的用法示例。
在下文中一共展示了WorkspaceManager.getWorkspacesNames方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestWorkspacesManagement
# 需要導入模塊: from managers.model_managers import WorkspaceManager [as 別名]
# 或者: from managers.model_managers.WorkspaceManager import getWorkspacesNames [as 別名]
#.........這裏部分代碼省略.........
self.wm.createWorkspace(wname, 'a desc', DBTYPE.COUCHDB)
self.assertTrue(self.mappersManager.find(wname), "Workspace document not found")
#Delete workspace
self.wm.removeWorkspace(wname)
self.assertIsNone(self.mappersManager.find(wname))
self.assertFalse(self.dbManager.connectorExists(wname))
def test_delete_fs_workspace(self):
"""
Verifies the deletion of a filesystem workspace
"""
wname = self.new_random_workspace_name()
self.wm.createWorkspace(wname, 'desc', DBTYPE.FS)
wpath = os.path.expanduser("~/.faraday/persistence/%s" % wname)
self.assertTrue(os.path.exists(wpath))
#Delete workspace
self.wm.removeWorkspace(wname)
self.assertFalse(os.path.exists(wpath))
def test_list_workspaces(self):
""" Lists FS workspaces and Couch workspaces """
# First create workspaces manually
wnamefs = self.new_random_workspace_name()
wnamecouch = self.new_random_workspace_name()
# FS
self.wm.createWorkspace(wnamefs, 'a desc', DBTYPE.FS)
# Couch
self.wm.createWorkspace(wnamecouch, 'a desc', DBTYPE.COUCHDB)
self.assertIn(wnamefs, self.wm.getWorkspacesNames(), 'FS Workspace not loaded')
self.assertIn(wnamecouch, self.wm.getWorkspacesNames(), 'Couch Workspace not loaded')
self.assertEquals(self.wm.getWorkspaceType(wnamecouch), 'CouchDB', 'Workspace type bad defined' )
self.assertEquals(self.wm.getWorkspaceType(wnamefs), 'FS', 'Workspace type bad defined')
def test_get_workspace(self):
""" Create a workspace, now ask for it """
# When
wname = self.new_random_workspace_name()
workspace = self.wm.createWorkspace(wname, 'a desc', DBTYPE.FS)
added_workspace = self.wm.openWorkspace(wname)
# Then
self.assertIsNotNone(workspace, 'Workspace added should not be none')
self.assertEquals(workspace, added_workspace, 'Workspace created and added diffier')
def _test_get_existent_couch_workspace(self): # Deprecate
""" Create a workspace in the backend, now ask for it """
# When
wname = self.new_random_workspace_name()
workspace = self.cdm.addWorkspace(wname)
added_workspace = self.wm.getWorkspace(wname)
# Then
self.assertIsNotNone(added_workspace, 'Workspace added should not be none')
def _test_get_existent_fs_workspace(self): # Deprecate