1
0
mirror of synced 2026-01-27 16:02:00 -05:00
Files
airbyte/airbyte-integrations/connectors/source-sentry/unit_tests/test_source.py
Marcos Marx dca2256a7c Bump 2022 license version (#13233)
* Bump year in license short to 2022

* remove protocol from cdk
2022-05-26 15:00:42 -03:00

27 lines
840 B
Python

#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
from source_sentry.source import SourceSentry
from source_sentry.streams import Projects
def test_check_connection(mocker):
source = SourceSentry()
logger_mock, config_mock = MagicMock(), MagicMock()
mocker.patch.object(Projects, "read_records", return_value=iter([{"id": "1", "name": "test"}]))
assert source.check_connection(logger_mock, config_mock) == (True, None)
def test_streams(mocker):
source = SourceSentry()
config_mock = MagicMock()
config_mock["auth_token"] = "test-token"
config_mock["organization"] = "test-organization"
config_mock["project"] = "test-project"
streams = source.streams(config_mock)
expected_streams_number = 4
assert len(streams) == expected_streams_number