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


Python CLBNode.is_done_draining方法代码示例

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


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

示例1: test_done_draining_before_timeout_if_there_are_no_connections

# 需要导入模块: from otter.convergence.model import CLBNode [as 别名]
# 或者: from otter.convergence.model.CLBNode import is_done_draining [as 别名]
 def test_done_draining_before_timeout_if_there_are_no_connections(self):
     """
     If there are zero connections, but the node has been in draining less
     than the timeout, :func:`CLBNode.is_done_draining` returns `True`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0, connections=0)
     self.assertTrue(node.is_done_draining(now=15, timeout=30))
开发者ID:pratikmallya,项目名称:otter,代码行数:9,代码来源:test_model.py

示例2: test_done_draining_past_timeout_even_if_there_are_connections

# 需要导入模块: from otter.convergence.model import CLBNode [as 别名]
# 或者: from otter.convergence.model.CLBNode import is_done_draining [as 别名]
 def test_done_draining_past_timeout_even_if_there_are_connections(self):
     """
     If there are still connections, but the node has been in draining past
     the timeout, :func:`CLBNode.is_done_draining` returns `True`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0, connections=1)
     self.assertTrue(node.is_done_draining(now=30, timeout=15))
开发者ID:pratikmallya,项目名称:otter,代码行数:9,代码来源:test_model.py

示例3: test_not_done_draining_before_timeout_if_no_connection_info

# 需要导入模块: from otter.convergence.model import CLBNode [as 别名]
# 或者: from otter.convergence.model.CLBNode import is_done_draining [as 别名]
 def test_not_done_draining_before_timeout_if_no_connection_info(self):
     """
     If connection information is not provided, and the node has been in
     draining less than the timeout, :func:`CLBNode.is_done_draining`
     returns `False`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0)
     self.assertFalse(node.is_done_draining(now=15, timeout=30))
开发者ID:pratikmallya,项目名称:otter,代码行数:10,代码来源:test_model.py

示例4: test_done_draining_past_timeout_even_if_no_connection_info

# 需要导入模块: from otter.convergence.model import CLBNode [as 别名]
# 或者: from otter.convergence.model.CLBNode import is_done_draining [as 别名]
 def test_done_draining_past_timeout_even_if_no_connection_info(self):
     """
     If connection information is not provided, and the node has been in
     draining past the timeout, :func:`CLBNode.is_done_draining` returns
     `True`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0)
     self.assertTrue(node.is_done_draining(now=30, timeout=15))
开发者ID:pratikmallya,项目名称:otter,代码行数:10,代码来源:test_model.py


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