* Source Github: better error explanation for 401 * Source Github: bump version, update changelog * Source Github: fix test name * Source Github: fix unittests * Source Github: bump version * auto-bump connector version --------- Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
23 lines
912 B
Python
23 lines
912 B
Python
#
|
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
#
|
|
|
|
from airbyte_cdk.sources.streams.http.auth import MultipleTokenAuthenticator
|
|
from source_github import SourceGithub
|
|
|
|
|
|
def test_single_token():
|
|
authenticator = SourceGithub()._get_authenticator({"access_token": "123"})
|
|
assert isinstance(authenticator, MultipleTokenAuthenticator)
|
|
assert ["123"] == authenticator._tokens
|
|
authenticator = SourceGithub()._get_authenticator({"credentials": {"access_token": "123"}})
|
|
assert ["123"] == authenticator._tokens
|
|
authenticator = SourceGithub()._get_authenticator({"credentials": {"personal_access_token": "123"}})
|
|
assert ["123"] == authenticator._tokens
|
|
|
|
|
|
def test_multiple_tokens():
|
|
authenticator = SourceGithub()._get_authenticator({"access_token": "123, 456"})
|
|
assert isinstance(authenticator, MultipleTokenAuthenticator)
|
|
assert ["123", "456"] == authenticator._tokens
|