1
0
mirror of synced 2026-01-08 21:05:13 -05:00
Files
airbyte/airbyte-integrations/connectors/source-strava/unit_tests/test_source.py
midavadim bb62d8089b 🎉 Source Strava - enable to cloud, to beta (#24101)
* 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>
2023-03-22 16:27:05 +01:00

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')")