当前位置: 首页>>代码示例>>Python>>正文


Python Vault.create方法代码示例

本文整理汇总了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')
开发者ID:BenjamenMeyer,项目名称:deuce,代码行数:11,代码来源:vault.py

示例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
开发者ID:BenjamenMeyer,项目名称:deuce,代码行数:12,代码来源:test_model.py

示例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
开发者ID:BenjamenMeyer,项目名称:deuce,代码行数:15,代码来源:test_model.py

示例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
开发者ID:BenjamenMeyer,项目名称:deuce,代码行数:22,代码来源:test_model.py

示例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
开发者ID:raxyu,项目名称:deuce-pub,代码行数:7,代码来源:vault.py

示例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
开发者ID:TheSriram,项目名称:deuce,代码行数:5,代码来源:vault.py


注:本文中的deuce.model.Vault.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。