本文整理汇总了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