Skip to content

Commit

Permalink
#9322 source marketo: fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov-d committed Jun 20, 2022
1 parent f804289 commit 6d9269a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def stream_slices(

status, export_id = export.get("status", "").lower(), export.get("exportId")
if status != "created" or not export_id:
self.logger.warning(f"Filed to create export job for data slice {date_slice}!")
self.logger.warning(f"Failed to create export job for data slice {date_slice}!")
continue
date_slice["id"] = export_id
yield date_slice
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#

import logging
from unittest.mock import ANY

from airbyte_cdk.models.airbyte_protocol import SyncMode


def test_create_export_job(send_email_stream, caplog):
caplog.set_level(logging.WARNING)
slices = list(send_email_stream.stream_slices(sync_mode=SyncMode.incremental))
assert slices == [
{"endAt": ANY, "id": "2c09ce6d", "startAt": ANY},
{"endAt": ANY, "id": "cd465f55", "startAt": ANY},
{"endAt": ANY, "id": "232aafb4", "startAt": ANY},
]
assert "Filed to create export job for data slice " in caplog.records[-1].message
assert "Failed to create export job for data slice " in caplog.records[-1].message

0 comments on commit 6d9269a

Please sign in to comment.