1
0
mirror of synced 2026-01-10 18:02:07 -05:00
Files
airbyte/airbyte-integrations/connectors/source-fastbill/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

40 lines
990 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
import responses
from source_fastbill.source import SourceFastbill
@responses.activate
def test_check_connection(mocker):
url = "https://my.fastbill.com/api/1.0/api.php"
source = SourceFastbill()
logger_mock, config_mock = MagicMock(), MagicMock()
responses.add(
responses.POST,
url,
json={
"REQUEST": {
"OFFSET": 0,
"FILTER": [],
"LIMIT": 0,
},
"RESPONSE": {
"CUSTOMERS": "",
},
},
)
assert source.check_connection(logger_mock, config_mock) == (True, None)
def test_streams(mocker):
source = SourceFastbill()
config_mock = MagicMock()
streams = source.streams(config_mock)
# TODO: replace this with your streams number
expected_streams_number = 5
assert len(streams) == expected_streams_number