Kaap10 commented on code in PR #73939:
URL: https://github.com/apache/airflow/pull/73939#discussion_r4142746876


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_state_store.py:
##########
@@ -211,16 +211,29 @@ def test_non_finite_float_rejected_by_validator(self, 
bad_value):
             TaskStateStoreBody(value=bad_value)
 
     def test_set_nonexistent_dag_run_returns_404(self, test_client):
-        """set() raises ValueError when DagRun doesn't exist — should surface 
as 404."""
+        """Scope validation rejects non-existent DagRun with 404."""
         bad_url = 
f"/dags/{DAG_ID}/dagRuns/nonexistent_run/taskInstances/{TASK_ID}/state-store/job_id"
         response = test_client.put(bad_url, json={"value": "v"})
         assert response.status_code == 404
+        assert "Task instance not found" in response.json()["detail"]
 
     def test_set_nonexistent_task_id_returns_404(self, test_client):
-        """set() returns 404 when task_id doesn not match any TaskInstance in 
the run."""
+        """Scope validation returns 404 when task_id does not match any 
TaskInstance in the run."""
         bad_url = 
f"/dags/{DAG_ID}/dagRuns/{RUN_ID}/taskInstances/nonexistent_task/state-store/job_id"
         response = test_client.put(bad_url, json={"value": "v"})
         assert response.status_code == 404
+        assert "Task instance not found" in response.json()["detail"]
+

Review Comment:
   Good catch! Removed both redundant tests as they are already covered under 
`TestUnknownTaskInstance`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to