def post(request, environment_id, action_id): if api.action_allowed(request, environment_id): task_id = api.run_action(request, environment_id, action_id) url = reverse("horizon:murano:environments:action_result", args=(environment_id, task_id)) return JSONResponse({"url": url}) else: return JSONResponse()
def post(request, environment_id, action_id): if api.action_allowed(request, environment_id): task_id = api.run_action(request, environment_id, action_id) url = reverse('horizon:murano:scheduler:action_result', args=(environment_id, task_id)) return JSONResponse({'url': url}) else: return JSONResponse()
def post(request, environment_id, action_id): if api.action_allowed(request, environment_id): task_id = api.run_action(request, environment_id, action_id) url = reverse('horizon:murano:environments:action_result', args=(environment_id, task_id)) return JSONResponse({'url': url}) else: return JSONResponse()
def test_action_allowed(self, mock_log, mock_api): result = env_api.action_allowed(self.mock_request, self.env_id) self.assertTrue(result) env_api.api.muranoclient.assert_called_with(self.mock_request) self.assertTrue(mock_log.debug.called)
def test_action_allowed(self, mock_log, mock_api): result = env_api.action_allowed(self.mock_request, self.env_id) self.assertTrue(result) env_api.api.muranoclient.assert_called_with(self.mock_request) self.assertTrue(mock_log.debug.called)