def test_lb_change_node_status_1(self, *mocks): """Suspend server called""" lb_node_status = "" api.lb_change_node_status(self.conf, self.lb_id, self.lb_node_id, lb_node_status) for mock in mocks: self.assertTrue(mock.called)
def test_lb_change_node_status_0(self, *mocks): """Activate server called""" lb_node_status = "inservice" api.lb_change_node_status(self.conf, self.lb_id, self.lb_node_id, lb_node_status) for mock in mocks: self.assertTrue(mock.called)
def test_lb_change_node_status_2(self, *mocks): """return ok""" mocks[0].return_value = {'sf_id': 1, 'state': 'status'} api.lb_change_node_status(self.conf, self.lb_id, self.lb_node_id, 'status') self.assertFalse(mocks[1].called) self.assertFalse(mocks[2].called)
def test_lb_change_node_status_2(self, mock_api_0, mock_commands1, mock_commands2, mock_driver, mock_api_1, patch_bal): """return ok""" mock_api_0.return_value = {'state': 'status'} api.lb_change_node_status(self.conf, self.lb_id, self.lb_node_id, 'status') self.assertFalse(mock_commands1.called) self.assertFalse(mock_commands2.called)
def changeNodeStatus(self, req, **args): logger.debug("Got changeNodeStatus request. Request: %s", req) msg = core_api.lb_change_node_status(self.conf, args['id'], args['nodeID'], args['status']) return msg
def changeNodeStatus(self, req, lb_id, id, status, body): LOG.debug("Got changeNodeStatus request. Request: %s", req) result = core_api.lb_change_node_status(self.conf, lb_id, id, status) return {"node": result}