* fixed spec, added expected records, enabled high strictness, added unit tests * updated docs, formatting * Fix SAT * Automated Change * Fix typo in docs * auto-bump connector version --------- Co-authored-by: Serhii Lazebnyi <serhii.lazebnyi@globallogic.com> Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com> Co-authored-by: lazebnyi <lazebnyi@users.noreply.github.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
23 lines
855 B
Python
23 lines
855 B
Python
#
|
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
#
|
|
|
|
from source_strava.source import SourceStrava
|
|
|
|
|
|
def test_source_streams(config):
|
|
streams = SourceStrava().streams(config=config)
|
|
assert len(streams) == 2
|
|
|
|
|
|
def test_source_check_connection_success(config, requests_mock):
|
|
requests_mock.post("https://www.strava.com/oauth/token", json={"access_token": "my_access_token", "expires_in": 64000})
|
|
results = SourceStrava().check_connection(logger=None, config=config)
|
|
assert results == (True, None)
|
|
|
|
|
|
def test_source_check_connection_failed(config, requests_mock):
|
|
requests_mock.post("https://www.strava.com/oauth/token", status_code=401)
|
|
results = SourceStrava().check_connection(logger=None, config=config)
|
|
assert results == (False, "HTTPError('401 Client Error: None for url: https://www.strava.com/oauth/token')")
|