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))
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))
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))
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))
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))
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))
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))
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))