本文整理匯總了Python中deuce.model.Vault.create方法的典型用法代碼示例。如果您正苦於以下問題:Python Vault.create方法的具體用法?Python Vault.create怎麽用?Python Vault.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類deuce.model.Vault
的用法示例。
在下文中一共展示了Vault.create方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: on_put
# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
def on_put(self, req, resp, vault_id):
vault = Vault.create(vault_id)
# TODO: Need check and monitor failed vault.
logger.info('Vault [{0}] created'.format(vault_id))
if vault:
resp.status = falcon.HTTP_201
else:
raise errors.HTTPInternalServerError('Vault Creation Failed')
示例2: test_block_crud
# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
def test_block_crud(self):
vault_id = self.create_vault_id()
v = Vault.create(vault_id)
# Check for blocks, should be none
blocks_gen = v.get_blocks(0, 0)
blocks_list = list(blocks_gen)
assert len(blocks_list) == 0
示例3: test_vault_crud
# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
def test_vault_crud(self):
vault_id = self.create_vault_id()
v = Vault.get(vault_id)
assert v is None
v = Vault.create(vault_id)
assert v is not None
v.delete()
v = Vault.get(vault_id)
assert v is None
示例4: test_file_crud
# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
def test_file_crud(self):
vault_id = self.create_vault_id()
v = Vault.create(vault_id)
f = v.create_file()
assert isinstance(f, File)
assert f.vault_id == vault_id
file_id = f.file_id
assert(len(file_id) > 0)
file2 = v.get_file(file_id)
file2_length = v.get_file_length(file_id)
assert isinstance(file2, File)
assert file2.file_id == file_id
assert file2_length == 0
示例5: put
# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
def put(self, vault_name):
vault = Vault.create(vault_name)
# TODO: Need check and monitor failed vault.
logger.info('Vault [{0}] created'.format(vault_name))
response.status_code = 201 if vault else 500
示例6: post
# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
def post(self, vault_name):
vault = Vault.create(request.project_id, vault_name)
response.status_code = 201 if vault else 500