This is an automated email from the ASF dual-hosted git repository.
Miretpl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 3dfbef6cafa Add unit tests for HTTP provider exceptions (#69231)
3dfbef6cafa is described below
commit 3dfbef6cafa96f7c03fe3f66790dd6f79a2f3943
Author: gps23 <[email protected]>
AuthorDate: Sun Aug 23 01:52:09 2026 +0530
Add unit tests for HTTP provider exceptions (#69231)
---
.../tests/unit/always/test_project_structure.py | 1 -
providers/http/tests/unit/http/test_exceptions.py | 40 ++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/airflow-core/tests/unit/always/test_project_structure.py
b/airflow-core/tests/unit/always/test_project_structure.py
index 0d42a2201ca..9aa0a580fcd 100644
--- a/airflow-core/tests/unit/always/test_project_structure.py
+++ b/airflow-core/tests/unit/always/test_project_structure.py
@@ -171,7 +171,6 @@ class TestProjectStructure:
"providers/google/tests/unit/google/cloud/utils/test_bigquery_get_data.py",
"providers/google/tests/unit/google/common/hooks/test_operation_helpers.py",
"providers/google/tests/unit/google/test_go_module_utils.py",
- "providers/http/tests/unit/http/test_exceptions.py",
"providers/microsoft/azure/tests/unit/microsoft/azure/operators/test_adls.py",
"providers/snowflake/tests/unit/snowflake/triggers/test_snowflake_trigger.py",
"providers/standard/tests/unit/standard/operators/test_branch.py",
diff --git a/providers/http/tests/unit/http/test_exceptions.py
b/providers/http/tests/unit/http/test_exceptions.py
new file mode 100644
index 00000000000..846e25311cb
--- /dev/null
+++ b/providers/http/tests/unit/http/test_exceptions.py
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+from airflow.providers.common.compat.sdk import AirflowException
+from airflow.providers.http.exceptions import (
+ HttpErrorException,
+ HttpMethodException,
+)
+
+
+def test_http_error_exception():
+ """Verify HttpErrorException inherits from AirflowException."""
+ exc = HttpErrorException("HTTP request failed")
+
+ assert isinstance(exc, AirflowException)
+ assert str(exc) == "HTTP request failed"
+
+
+def test_http_method_exception():
+ """Verify HttpMethodException inherits from AirflowException."""
+ exc = HttpMethodException("Invalid HTTP method")
+
+ assert isinstance(exc, AirflowException)
+ assert str(exc) == "Invalid HTTP method"