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