Created
November 25, 2021 18:14
-
-
Save mfurquimdev/8e42e5087b6a6ad0d4e0673a01cdb83b to your computer and use it in GitHub Desktop.
Revisions
-
mfurquimdev created this gist
Nov 25, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ @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