def test_lb_add_nodes(self, *mocks): mocks[2].return_value = {'device_id': 1} mocks[3].return_value = [{'id': 1}] api.lb_add_nodes(self.conf, self.lb_id, self.lb_nodes) for mok in mocks: self.assertTrue(mok.called, "This mock didn't call %s" % mok._mock_name)
def test_lb_add_nodes(self, mock_command, mock_driver, mock_bal): api.lb_add_nodes(self.conf, self.lb_id, self.lb_nodes) self.assertTrue(mock_command.called) self.assertTrue(mock_command.call_count == 2) self.assertTrue(mock_driver.called) self.assertTrue(mock_driver.call_count == 2)
def addNodes(self, req, **args): logger.debug("Got addNode request. Request: %s", req) return core_api.lb_add_nodes(self.conf, args['id'], args['body']['nodes'])
def create(self, req, lb_id, body): LOG.debug("Got addNode request. Request: %s", req) return {'nodes': core_api.lb_add_nodes(self.conf, lb_id, body['nodes'])}
def addNodes(self, req, id, body): logger.debug("Got addNode request. Request: %s", req) return core_api.lb_add_nodes(self.conf, id, body['nodes'])