Skip to content

Commit

Permalink
Added tests around streams being enabled depending on tap settings pr…
Browse files Browse the repository at this point in the history
…ovided
  • Loading branch information
DanielPDWalker committed Jun 25, 2023
1 parent 7e25c11 commit 4234839
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions tests/test_core.py
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",
)

0 comments on commit 4234839

Please sign in to comment.