@pytest.mark.asyncio @pytest.mark.parametrize( "request_body", [ { "start_date": "2021-02-01 00:00:00", "sensors": [], }, {"start_date": "2021-02-01 00:00:00", "end_date": "2021-02-01 00:30:00"}, ], ) async def test_recalculation_missing_input_parameters( request_body, async_client, monkeypatch ): def build_run_workflow_mock(*args, **kwargs): class TaskMock: id = "id1" return TaskMock() monkeypatch.setattr( "app.disaggregation.view.build_run_workflow", build_run_workflow_mock ) log.info(f'request_body = {request_body}') response = await async_client.post("/recalculation", json=request_body) assert response.status_code == 422