amoghrajesh commented on code in PR #67547:
URL: https://github.com/apache/airflow/pull/67547#discussion_r3309104103
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_state.py:
##########
@@ -191,6 +193,18 @@ def test_overwrites_existing_key(self, test_client):
def test_empty_body_returns_422(self, test_client):
assert test_client.put(f"{BASE_URL}/job_id", json={}).status_code ==
422
+ def test_null_value_returns_422(self, test_client):
+ assert test_client.put(f"{BASE_URL}/job_id", json={"value":
None}).status_code == 422
+
+ @pytest.mark.parametrize("bad_float", [float("nan"), float("inf"),
float("-inf")])
+ def test_non_finite_float_returns_422(self, test_client, bad_float):
+ with pytest.raises(ValueError, match="Out of range float values are
not JSON compliant"):
Review Comment:
Made changes.
- Endpoint tests now status code instead of catching ValueError
- Added a new `test_non_finite_float_rejected_by_validator` which tests the
validator directly with both top-level and nested non-finite floats
--
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]