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


Python AgentHeartBeat.find_all_by_version方法代码示例

本文整理汇总了Python中trove.guestagent.models.AgentHeartBeat.find_all_by_version方法的典型用法代码示例。如果您正苦于以下问题:Python AgentHeartBeat.find_all_by_version方法的具体用法?Python AgentHeartBeat.find_all_by_version怎么用?Python AgentHeartBeat.find_all_by_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在trove.guestagent.models.AgentHeartBeat的用法示例。


在下文中一共展示了AgentHeartBeat.find_all_by_version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_find_all_by_version_none

# 需要导入模块: from trove.guestagent.models import AgentHeartBeat [as 别名]
# 或者: from trove.guestagent.models.AgentHeartBeat import find_all_by_version [as 别名]
    def test_find_all_by_version_none(self):
        """
        Test to retrieve all guest agents with a None version
        """
        heartbeats = None
        exception_raised = False
        try:
            heartbeats = AgentHeartBeat.find_all_by_version(None)
        except exception.ModelNotFoundError:
            exception_raised = True

        self.assertIsNone(heartbeats)
        self.assertTrue(exception_raised)
开发者ID:magictour,项目名称:trove,代码行数:15,代码来源:test_agent_heartbeats_models.py

示例2: test_find_all_by_version_not_found

# 需要导入模块: from trove.guestagent.models import AgentHeartBeat [as 别名]
# 或者: from trove.guestagent.models.AgentHeartBeat import find_all_by_version [as 别名]
    def test_find_all_by_version_not_found(self):
        """
        Test to retrieve all guest agents with a non-existing version
        """
        version = str(uuid.uuid4())
        exception_raised = False
        heartbeats = None
        try:
            heartbeats = AgentHeartBeat.find_all_by_version(version)
        except exception.ModelNotFoundError:
            exception_raised = True

        self.assertIsNone(heartbeats)
        self.assertTrue(exception_raised)
开发者ID:magictour,项目名称:trove,代码行数:16,代码来源:test_agent_heartbeats_models.py

示例3: test_find_all_by_version

# 需要导入模块: from trove.guestagent.models import AgentHeartBeat [as 别名]
# 或者: from trove.guestagent.models.AgentHeartBeat import find_all_by_version [as 别名]
    def test_find_all_by_version(self):
        """
        Test to retrieve all guest agents with a particular version
        """
        # create some unique records with the same version
        version = str(uuid.uuid4())

        for x in xrange(5):
            instance_id = str(uuid.uuid4())
            heartbeat = AgentHeartBeat.create(
                instance_id=instance_id,
                guest_agent_version=version,
                deleted=0)
            self.assertIsNotNone(heartbeat)

        # get all guests by version
        heartbeats = AgentHeartBeat.find_all_by_version(version)
        self.assertIsNotNone(heartbeats)
        self.assertEqual(5, heartbeats.count())
开发者ID:magictour,项目名称:trove,代码行数:21,代码来源:test_agent_heartbeats_models.py


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