diff --git a/airflow-core/tests/unit/always/test_project_structure.py b/airflow-core/tests/unit/always/test_project_structure.py index 750966a320221..f316e168702b9 100644 --- a/airflow-core/tests/unit/always/test_project_structure.py +++ b/airflow-core/tests/unit/always/test_project_structure.py @@ -172,7 +172,6 @@ def test_providers_modules_should_have_tests(self): "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/keycloak/tests/unit/keycloak/auth_manager/datamodels/test_token.py", "providers/microsoft/azure/tests/unit/microsoft/azure/operators/test_adls.py", "providers/snowflake/tests/unit/snowflake/triggers/test_snowflake_trigger.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 0000000000000..e9c8f1572de2f --- /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" \ No newline at end of file