-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding unit tests and applied gradle formatting
- Loading branch information
1 parent
4e17c55
commit 2308c8c
Showing
6 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-integrations/connectors/source-shortio/integration_tests/state.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"clicks": { | ||
"dt": "2022-07-26 14:03:43.449925" | ||
"dt": "2022-07-27 10:30:43.449925" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
airbyte-integrations/connectors/source-shortio/unit_tests/test_source.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
import pytest | ||
from airbyte_cdk.logger import AirbyteLogger | ||
from airbyte_cdk.models import Status | ||
from source_shortio.source import SourceShortio | ||
|
||
|
||
@pytest.fixture | ||
def config(): | ||
return {"domain_id": "foo", "secret_key": "bar", "start_date": "2030-01-01"} | ||
|
||
|
||
def test_source_shortio_client_wrong_credentials(): | ||
source = SourceShortio() | ||
result = source.check(logger=AirbyteLogger, config={"domain_id": "foo", "secret_key": "bar", "start_date": "2030-01-01"}) | ||
assert result.status == Status.FAILED | ||
|
||
|
||
def test_streams(): | ||
source = SourceShortio() | ||
config_mock = {"domain_id": "foo", "secret_key": "bar", "start_date": "2030-01-01"} | ||
streams = source.streams(config_mock) | ||
expected_streams_number = 2 | ||
assert len(streams) == expected_streams_number |
7 changes: 0 additions & 7 deletions
7
airbyte-integrations/connectors/source-shortio/unit_tests/unit_test.py
This file was deleted.
Oops, something went wrong.