* new connector source-clockify * feat: enable caching for streams (users, projects) * chore: pep8 changes at unit_tests * chore: pep8 changes at integration_tests * chore: update schema * Adds python formatting, removes unused import. * Makes the task duration field nullable to pass integration test. * fix: add second type to null values to the schema files * Adds a null fallback value to task duration. * Updates airbyte-cdk dependency. * Adds UUID in source definitions. * auto-bump connector version * Requested changes. * add clockify to source def seed * correct spec.json add titles * add icon * run format * remove source spec * correct spec * add eof gitignore * auto-bump connector version Co-authored-by: nataly <nataly@airbyte.io> Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com> Co-authored-by: Nataly Merezhuk <65251165+natalyjazzviolin@users.noreply.github.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com> Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
34 lines
803 B
Python
34 lines
803 B
Python
#
|
|
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
|
|
#
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
import responses
|
|
from source_clockify.source import SourceClockify
|
|
|
|
|
|
def setup_responses():
|
|
responses.add(
|
|
responses.GET,
|
|
"https://api.clockify.me/api/v1/workspaces/workspace_id/users",
|
|
json={"access_token": "test_api_key", "expires_in": 3600},
|
|
)
|
|
|
|
|
|
@responses.activate
|
|
def test_check_connection(config):
|
|
setup_responses()
|
|
source = SourceClockify()
|
|
logger_mock = MagicMock()
|
|
assert source.check_connection(logger_mock, config) == (True, None)
|
|
|
|
|
|
def test_streams(mocker):
|
|
source = SourceClockify()
|
|
config_mock = MagicMock()
|
|
streams = source.streams(config_mock)
|
|
|
|
expected_streams_number = 7
|
|
assert len(streams) == expected_streams_number
|