def test_lb_update_node_1(self, mock_com0, mock_com1, mock_api0, *mocks): """""" mock_api0.return_value = self.dictionary api.lb_update_node(self.conf, self.lb_id, 1, self.lb_node) self.assertTrue(mock_com0.called) self.assertTrue(mock_com1.called)
def test_lb_update_node(self, mock_extra, mock_command1, mock_command2, mock_sf, mock_lb, mock_get, mock_update, mock_driver): """""" mock_extra.return_value = self.dictionary mock_lb.return_value.__getitem__.return_value = 2 resp = api.lb_update_node(self.conf, self.lb_id, self.lb_node_id, self.lb_node) self.assertEqual(resp, self.dictionary) mock_update.assert_called_once_with(self.conf, mock_get.return_value['id'], mock_get.return_value) mock_extra.assert_called_once_with(mock_update.return_value) mock_get.assert_called_once_with(self.conf, self.lb_node_id) mock_sf.assert_called_once_with(self.conf, mock_get.return_value['sf_id']) mock_lb.assert_called_once_with(self.conf, self.lb_id) mock_driver.assert_called_once_with(self.conf, 2) with mock_driver.return_value.request_context() as ctx: mock_command1.assert_called_once_with(ctx, mock_sf.return_value, mock_update.return_value) mock_command2.assert_called_once_with(ctx, mock_sf.return_value, mock_get.return_value)
def test_lb_update_node_0(self, mock_com0, mock_com1, *mocks): """""" api.lb_update_node(self.conf, self.lb_id, self.lb_node_id, self.lb_node) self.assertTrue(mock_com0.called) self.assertTrue(mock_com1.called)
def updateNode(self, req, lb_id, lb_node_id, body): logger.debug("Got updateNode request. Request: %s", req) node = core_api.lb_update_node(self.conf, lb_id, lb_node_id, body) return {'node': node}
def update(self, req, lb_id, id, body): LOG.debug("Got updateNode request. Request: %s", req) result = core_api.lb_update_node(self.conf, lb_id, id, body) return {"node": result}