1
0
mirror of synced 2026-01-08 12:03:02 -05:00
Files
airbyte/airbyte-integrations/connectors/source-iterable/unit_tests/conftest.py
Serhii Chvaliuk eff127ee20 Source: Iterable - improve 500 handling for Events stream (#26014)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>

---------

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2023-05-15 20:30:17 +03:00

50 lines
1.3 KiB
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import pytest
from airbyte_cdk.models import AirbyteStream, ConfiguredAirbyteCatalog, ConfiguredAirbyteStream
@pytest.fixture(autouse=True)
def disable_cache(mocker):
mocker.patch("source_iterable.streams.ListUsers.use_cache", False)
@pytest.fixture
def catalog(request):
return ConfiguredAirbyteCatalog(
streams=[
ConfiguredAirbyteStream(
stream=AirbyteStream(name=request.param, json_schema={}, supported_sync_modes=["full_refresh"]),
sync_mode="full_refresh",
destination_sync_mode="append",
)
]
)
@pytest.fixture(name="config")
def config_fixture():
return {"api_key": 123, "start_date": "2019-10-10T00:00:00"}
@pytest.fixture()
def mock_lists_resp(mocker):
mocker.patch("source_iterable.streams.Lists.read_records", return_value=iter([{"id": 1}, {"id": 2}]))
@pytest.fixture(name="lists_stream")
def lists_stream():
# local imports
from source_iterable.streams import Lists
# return the instance of the stream so we could make global tests on it,
# to cover the different `should_retry` logic
return Lists(authenticator=None)
@pytest.fixture(autouse=True)
def mock_sleep(mocker):
mocker.patch("time.sleep")