Skip to content

Commit

Permalink
fixed test_email_stream_chunked_encoding: added records filtering (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
darynaishchenko authored Feb 1, 2023
1 parent 8fbd12d commit e29046f
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit e29046f

Please sign in to comment.