1
0
mirror of synced 2026-01-17 03:06:35 -05:00
Files
airbyte/airbyte-integrations/connectors/source-zenloop/unit_tests/test_source.py
jablonskijakub 1c0d237cd5 Source Zenloop: add new stream properties (#15843)
* add new stream properties

* add PR number

* change additionalProperties to true

* revert bumoed version of an image, add json schema in the tests files, remove additionalProperties: true

* gradle build completed

* improve test acceptance quality, adjust the order of objects for the properties json schema

* delete reduntant configured_catalog, add json schema for all streams

* auto-bump connector version [ci skip]

Co-authored-by: Sajarin <sajarindider@gmail.com>
Co-authored-by: Marie Amelie Sandrock <marieamelie94@gmail.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-09-19 05:39:11 -04:00

39 lines
1.1 KiB
Python

#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
import responses
from source_zenloop.source import SourceZenloop
@responses.activate
def test_check_connection_success(mocker, config):
responses.add(
responses.GET,
"https://api.zenloop.com/v1/surveys",
)
source = SourceZenloop()
logger_mock = MagicMock()
assert source.check_connection(logger_mock, config) == (True, None)
@responses.activate
def test_check_connection_fail(mocker, config):
responses.add(responses.GET, "https://api.zenloop.com/v1/surveys", json={"error": "Unauthorized"}, status=401)
source = SourceZenloop()
logger_mock = MagicMock()
assert source.check_connection(logger_mock, config) == (
False,
"Unable to connect to Zenloop API with the provided credentials - 401 Client Error: Unauthorized for url: https://api.zenloop.com/v1/surveys",
)
def test_streams(mocker):
source = SourceZenloop()
config_mock = MagicMock()
streams = source.streams(config_mock)
expected_streams_number = 5
assert len(streams) == expected_streams_number