Skip to content

Source Iterable: fixed test_email_stream_chunked_encoding: added records filtering #22202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from source_iterable.slice_generators import AdjustableSliceGenerator
from source_iterable.source import SourceIterable

from airbyte_cdk.models import Type as MessageType

TEST_START_DATE = "2020"


Expand Down Expand Up @@ -108,8 +110,8 @@ def response_cb(req):

responses.add(responses.GET, "https://api.iterable.com/api/lists/getUsers?listId=1", json={"lists": [{"id": 1}]}, status=200)
responses.add_callback("GET", "https://api.iterable.com/api/export/data.json", callback=response_cb)

records = read_from_source(catalog)
# added condition because read_from_source also returns LOG messages
records = [record for record in read_from_source(catalog) if record.type == MessageType.RECORD]
assert sum(ranges) == days_duration
assert len(ranges) == len(records)
# since read is called on source instance, under the hood .streams() is called which triggers one more http call
Expand Down