-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests around streams being enabled depending on tap settings pr…
…ovided
- Loading branch information
1 parent
7e25c11
commit 4234839
Showing
1 changed file
with
21 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
"""Tests standard tap features using the built-in SDK tests library.""" | ||
|
||
import datetime | ||
import unittest | ||
|
||
from singer_sdk.testing import get_tap_test_class | ||
|
||
from tap_theme_parks.tap import TapThemeParks | ||
|
||
SAMPLE_CONFIG = { | ||
"start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"), | ||
# TODO: Initialize minimal tap config | ||
} | ||
DEFAULT_CONFIG = {} | ||
|
||
SAMPLE_CONFIG = {"live_data_array": ["1", "2", "3"]} | ||
|
||
|
||
# Run standard built-in tap tests from the SDK: | ||
TestTapThemeParks = get_tap_test_class( | ||
tap_class=TapThemeParks, | ||
config=SAMPLE_CONFIG, | ||
config=DEFAULT_CONFIG, | ||
) | ||
|
||
|
||
# TODO: Create additional tests as appropriate for your tap. | ||
class TestEnabledStreams(unittest.TestCase): | ||
"""Test class for enabled streams""" | ||
|
||
def test_default_streams(self): | ||
catalog = TapThemeParks().discover_streams() | ||
|
||
self.assertEqual(len(catalog), 3, "Expected 3 streams from catalog by default") | ||
|
||
def test_streams_with_live_data_array(self): | ||
catalog = TapThemeParks(config=SAMPLE_CONFIG).discover_streams() | ||
|
||
self.assertEqual( | ||
len(catalog), | ||
5, | ||
"Expected 5 streams from catalog with the live_data_array setting provided", | ||
) |