Skip to content

Commit

Permalink
use put in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rawwar committed Oct 19, 2024
1 parent 28b6db8 commit 7d66c48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/api_fastapi/core_api/routes/public/test_dag_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,23 @@ class TestModifyDagRun:
],
)
def test_modify_dag_run(self, test_client, dag_id, run_id, state, response_state):
response = test_client.patch(f"/public/dags/{dag_id}/dagRuns/{run_id}", json={"state": state})
response = test_client.put(f"/public/dags/{dag_id}/dagRuns/{run_id}", json={"state": state})
assert response.status_code == 200
body = response.json()
assert body["dag_id"] == dag_id
assert body["run_id"] == run_id
assert body["state"] == response_state

def test_modify_dag_run_not_found(self, test_client):
response = test_client.patch(
response = test_client.put(
f"/public/dags/{DAG1_ID}/dagRuns/invalid", json={"state": DagRunState.SUCCESS}
)
assert response.status_code == 404
body = response.json()
assert body["detail"] == "The DagRun with dag_id: `test_dag1` and run_id: `invalid` was not found"

def test_modify_dag_run_bad_request(self, test_client):
response = test_client.patch(
response = test_client.put(
f"/public/dags/{DAG1_ID}/dagRuns/{DAG1_RUN1_ID}", json={"state": "running"}
)
assert response.status_code == 422
Expand Down

0 comments on commit 7d66c48

Please sign in to comment.