1
0
mirror of synced 2026-01-09 06:03:17 -05:00
Files
airbyte/airbyte-integrations/connectors/source-tplcentral/unit_tests/test_source.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

46 lines
1.1 KiB
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
from pytest import fixture
from source_tplcentral.source import SourceTplcentral
@fixture
def config():
return {
"url_base": "https://secure-wms.com/",
"client_id": "xxx",
"client_secret": "yyy",
"user_login_id": 123,
"tpl_key": "{00000000-0000-0000-0000-000000000000}",
"customer_id": 4,
"facility_id": 5,
"start_date": "2021-10-01",
}
def test_check_connection(requests_mock, config):
source = SourceTplcentral()
logger_mock = MagicMock()
requests_mock.post(
f"{config['url_base']}AuthServer/api/Token",
json={
"access_token": "the_token",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": None,
"scope": None,
},
)
assert source.check_connection(logger_mock, config) == (True, None)
def test_streams(config):
source = SourceTplcentral()
streams = source.streams(config)
expected_streams_number = 6
assert len(streams) == expected_streams_number