|
10 | 10 |
|
11 | 11 | import pytest |
12 | 12 | import requests |
| 13 | +from requests.exceptions import InvalidURL |
| 14 | + |
13 | 15 | from airbyte_cdk.models import AirbyteLogMessage, AirbyteMessage, Level, SyncMode, Type |
14 | 16 | from airbyte_cdk.sources.streams import CheckpointMixin |
15 | 17 | from airbyte_cdk.sources.streams.checkpoint import ResumableFullRefreshCursor |
|
19 | 21 | from airbyte_cdk.sources.streams.core import StreamData |
20 | 22 | from airbyte_cdk.sources.streams.http import HttpStream, HttpSubStream |
21 | 23 | from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, HttpStatusErrorHandler |
22 | | -from airbyte_cdk.sources.streams.http.error_handlers.response_models import FailureType, ResponseAction |
| 24 | +from airbyte_cdk.sources.streams.http.error_handlers.response_models import ( |
| 25 | + FailureType, |
| 26 | + ResponseAction, |
| 27 | +) |
23 | 28 | from airbyte_cdk.sources.streams.http.exceptions import ( |
24 | 29 | DefaultBackoffException, |
25 | 30 | RequestBodyException, |
|
28 | 33 | from airbyte_cdk.sources.streams.http.http_client import MessageRepresentationAirbyteTracedErrors |
29 | 34 | from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator |
30 | 35 | from airbyte_cdk.utils.airbyte_secrets_utils import update_secrets |
31 | | -from requests.exceptions import InvalidURL |
32 | 36 |
|
33 | 37 |
|
34 | 38 | class StubBasicReadHttpStream(HttpStream): |
@@ -335,6 +339,7 @@ class StubHttpStreamWithErrorHandler(StubBasicReadHttpStream): |
335 | 339 | def get_error_handler(self) -> Optional[ErrorHandler]: |
336 | 340 | return HttpStatusErrorHandler(logging.getLogger()) |
337 | 341 |
|
| 342 | + |
338 | 343 | def test_dns_resolution_error_retry(): |
339 | 344 | """Test that DNS resolution errors are retried""" |
340 | 345 | stream = StubHttpStreamWithErrorHandler() |
|
0 commit comments