1
0
mirror of synced 2026-01-17 21:02:47 -05:00
Files
airbyte/airbyte-integrations/connectors/source-github/unit_tests/unit_test.py
Cole Snodgrass 2e099acc52 update headers from 2022 -> 2023 (#22594)
* It's 2023!

* 2022 -> 2023

---------

Co-authored-by: evantahler <evan@airbyte.io>
2023-02-08 13:01:16 -08:00

23 lines
904 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