From e116cb2d15f921810c1e137ede564456646c3024 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 14:45:42 +0100 Subject: [PATCH 01/13] Add `is_selected` property to Stream class --- elx/catalog.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/elx/catalog.py b/elx/catalog.py index d4e1caa..3d0bb15 100644 --- a/elx/catalog.py +++ b/elx/catalog.py @@ -23,6 +23,19 @@ def safe_name(self) -> str: """""" return self.name.replace("-", "_") + @property + def is_selected(self) -> bool: + """Returns boolean flag indicating whether stream has been selected or not.""" + # Find the stream metadata by breadcrumb + metadata = self.find_metadata_by_breadcrumb(breadcrumb=[]) + + # If metadata does not exist, stream is not selected + if not metadata: + return False + + # If metadata does exists, return value of `selected` property + return metadata.get("selected", False) + def find_metadata_by_breadcrumb(self, breadcrumb: List[str]) -> Optional[dict]: """ Find metadata by breadcrumb. From bcf5779e2dd471d5961f4ce91a6df9681f3f5036 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 14:46:12 +0100 Subject: [PATCH 02/13] Filter asset loading based on `is_selected` property of stream --- elx/extensions/dagster/assets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/elx/extensions/dagster/assets.py b/elx/extensions/dagster/assets.py index 21ad38f..b385004 100644 --- a/elx/extensions/dagster/assets.py +++ b/elx/extensions/dagster/assets.py @@ -75,6 +75,7 @@ def run(context: OpExecutionContext) -> Generator[Output, None, None]: code_version=runner.tap.hash_key, ) for stream in runner.tap.catalog.streams + if stream.is_selected }, can_subset=True, group_name=dagster_safe_name(runner.tap.executable), From 11a7d644381c809879a11d8cf9bc8e3e602fef37 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 14:46:36 +0100 Subject: [PATCH 03/13] Add test fixtures for tap with multiple streams --- tests/conftest.py | 4 ++-- tests/fixtures/runner.py | 15 +++++++++++++++ tests/fixtures/tap.py | 26 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 067a7c7..107839d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ from fixtures.singer import singer -from fixtures.tap import tap, tap_incremental +from fixtures.tap import tap, tap_incremental, tap_multiple_streams from fixtures.target import target -from fixtures.runner import runner +from fixtures.runner import runner, runner_with_deselected_stream from fixtures.state import state_manager diff --git a/tests/fixtures/runner.py b/tests/fixtures/runner.py index 311de7a..e210a36 100644 --- a/tests/fixtures/runner.py +++ b/tests/fixtures/runner.py @@ -15,3 +15,18 @@ def runner(tmp_path, tap: Tap, target: Target) -> Generator[Runner, None, None]: target=target, state_manager=StateManager(base_path=str(tmp_path)), ) + + +@pytest.fixture +def runner_with_deselected_stream( + tmp_path, tap_multiple_streams: Tap, target: Target +) -> Generator[Runner, None, None]: + """ + Return a Runner instance for the tap-smoke-test executable with two streams, + of which one is deselected. + """ + yield Runner( + tap=tap_multiple_streams, + target=target, + state_manager=StateManager(base_path=str(tmp_path)), + ) diff --git a/tests/fixtures/tap.py b/tests/fixtures/tap.py index 5780457..bc0fba6 100644 --- a/tests/fixtures/tap.py +++ b/tests/fixtures/tap.py @@ -32,3 +32,29 @@ def tap_incremental() -> Generator[Tap, None, None]: spec="git+https://github.com/quantile-taps/tap-mock-incremental.git", config={}, ) + + +@pytest.fixture(scope="session") +def tap_multiple_streams() -> Generator[Tap, None, None]: + """ + Return a Tap instance for the tap-smoke-test executable with two streams. + + One stream is selected and one stream is deselected. + """ + yield Tap( + executable="tap-smoke-test", + spec="git+https://github.com/meltano/tap-smoke-test.git", + config={ + "streams": [ + { + "stream_name": "animals", + "input_filename": "https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl", + }, + { + "stream_name": "animals-two", + "input_filename": "https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl", + }, + ], + }, + deselected=["animals-two"], + ) From fa57c411afa2d1f3ff5675097e9d940c8375cd9d Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 14:46:50 +0100 Subject: [PATCH 04/13] Simplify catalog tests --- tests/test_elx/test_catalog.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/test_elx/test_catalog.py b/tests/test_elx/test_catalog.py index ab4b026..982e03e 100644 --- a/tests/test_elx/test_catalog.py +++ b/tests/test_elx/test_catalog.py @@ -116,14 +116,12 @@ def test_catalog(tap: Tap): def test_catalog_select(tap: Tap): """If we select a stream, the catalog should be updated.""" catalog = tap.catalog.select(["animals"]) - catalog_dict = catalog.dict(by_alias=True) - assert catalog_dict["streams"][0]["metadata"][-1]["metadata"]["selected"] == True + assert catalog.streams[0].is_selected == True catalog = tap.catalog.select([]) - catalog_dict = catalog.dict(by_alias=True) - assert catalog_dict["streams"][0]["metadata"][-1]["metadata"]["selected"] == False + assert catalog.streams[0].is_selected == False def test_catalog_no_deselect(tap: Tap): @@ -135,9 +133,8 @@ def test_catalog_no_deselect(tap: Tap): def test_catalog_deselect_stream(tap: Tap): """If we deselect a stream, the catalog should be updated.""" catalog = tap.catalog.deselect(["animals"]) - catalog_dict = catalog.dict(by_alias=True) - assert catalog_dict["streams"][0]["metadata"][-1]["metadata"]["selected"] == False + assert catalog.streams[0].is_selected == False def test_catalog_deselect_invalid_stream(tap: Tap): From 93ea1392ada327293c8999c6bb3f51f626b6c551 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 14:47:01 +0100 Subject: [PATCH 05/13] Add asset loading test for deselected stream --- .../test_extensions/test_dagster/test_assets.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_elx/test_extensions/test_dagster/test_assets.py b/tests/test_elx/test_extensions/test_dagster/test_assets.py index 7d81a67..f4d0526 100644 --- a/tests/test_elx/test_extensions/test_dagster/test_assets.py +++ b/tests/test_elx/test_extensions/test_dagster/test_assets.py @@ -10,3 +10,15 @@ def test_asset_loading(runner: Runner): assets = load_assets(runner) assert len(assets) == 1 assert isinstance(assets[0], AssetsDefinition) + + +def test_asset_loading_with_deselected_stream(runner_with_deselected_stream: Runner): + """ + Test that assets are loaded correctly. + """ + # Verifies that the associated tap has multiple streams + assert len(runner_with_deselected_stream.tap.catalog.streams) == 2 + + assets = load_assets(runner_with_deselected_stream) + assert len(assets) == 1 + assert isinstance(assets[0], AssetsDefinition) From 1655d9c0abecfe1f7aa791ffbf30fa099ba88582 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 14:58:02 +0100 Subject: [PATCH 06/13] Adjust default `is_selected` setting --- elx/catalog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elx/catalog.py b/elx/catalog.py index 3d0bb15..20109be 100644 --- a/elx/catalog.py +++ b/elx/catalog.py @@ -29,12 +29,12 @@ def is_selected(self) -> bool: # Find the stream metadata by breadcrumb metadata = self.find_metadata_by_breadcrumb(breadcrumb=[]) - # If metadata does not exist, stream is not selected + # If metadata does not exist, stream should be considered selected if not metadata: - return False + return True # If metadata does exists, return value of `selected` property - return metadata.get("selected", False) + return metadata.get("selected", True) def find_metadata_by_breadcrumb(self, breadcrumb: List[str]) -> Optional[dict]: """ From 389268e419d9b900a77fca63b697c713dbdb4748 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:41:54 +0100 Subject: [PATCH 07/13] Use custom tap-mock-fixture for testing --- tests/fixtures/tap.py | 49 ++----------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/tests/fixtures/tap.py b/tests/fixtures/tap.py index bc0fba6..b334d9b 100644 --- a/tests/fixtures/tap.py +++ b/tests/fixtures/tap.py @@ -5,56 +5,11 @@ @pytest.fixture(scope="session") def tap() -> Generator[Tap, None, None]: - """ - Return a Tap instance for the tap-smoke-test executable. - """ - yield Tap( - executable="tap-smoke-test", - spec="git+https://github.com/meltano/tap-smoke-test.git", - config={ - "streams": [ - { - "stream_name": "animals", - "input_filename": "https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl", - }, - ], - }, - ) - - -@pytest.fixture(scope="session") -def tap_incremental() -> Generator[Tap, None, None]: """ Return a Tap instance for the executable with an incremental stream. """ yield Tap( - executable="tap-mock-incremental", - spec="git+https://github.com/quantile-taps/tap-mock-incremental.git", + executable="tap-mock-fixture", + spec="git+https://github.com/quantile-taps/tap-mock-fixture.git", config={}, ) - - -@pytest.fixture(scope="session") -def tap_multiple_streams() -> Generator[Tap, None, None]: - """ - Return a Tap instance for the tap-smoke-test executable with two streams. - - One stream is selected and one stream is deselected. - """ - yield Tap( - executable="tap-smoke-test", - spec="git+https://github.com/meltano/tap-smoke-test.git", - config={ - "streams": [ - { - "stream_name": "animals", - "input_filename": "https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl", - }, - { - "stream_name": "animals-two", - "input_filename": "https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl", - }, - ], - }, - deselected=["animals-two"], - ) From 865b3ec4607d1aea0a7436cfebdfefd1d2caa5aa Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:42:21 +0100 Subject: [PATCH 08/13] Remove fixtures --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 107839d..746ec38 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ from fixtures.singer import singer -from fixtures.tap import tap, tap_incremental, tap_multiple_streams +from fixtures.tap import tap from fixtures.target import target -from fixtures.runner import runner, runner_with_deselected_stream +from fixtures.runner import runner from fixtures.state import state_manager From e78712d770ed085a681dfabd11c9c8ba46cf96f2 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:42:33 +0100 Subject: [PATCH 09/13] Update runner fixture --- tests/fixtures/runner.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/fixtures/runner.py b/tests/fixtures/runner.py index e210a36..f7b2d83 100644 --- a/tests/fixtures/runner.py +++ b/tests/fixtures/runner.py @@ -8,25 +8,10 @@ @pytest.fixture def runner(tmp_path, tap: Tap, target: Target) -> Generator[Runner, None, None]: """ - Return a Runner instance for the tap-smoke-test executable. + Return a Runner instance for the tap-mock-fixture executable. """ yield Runner( tap=tap, target=target, state_manager=StateManager(base_path=str(tmp_path)), ) - - -@pytest.fixture -def runner_with_deselected_stream( - tmp_path, tap_multiple_streams: Tap, target: Target -) -> Generator[Runner, None, None]: - """ - Return a Runner instance for the tap-smoke-test executable with two streams, - of which one is deselected. - """ - yield Runner( - tap=tap_multiple_streams, - target=target, - state_manager=StateManager(base_path=str(tmp_path)), - ) From a28bd20812c9bdaf13e313cb2502ebe48cda11af Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:42:44 +0100 Subject: [PATCH 10/13] Update singer fixture --- tests/fixtures/singer.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/fixtures/singer.py b/tests/fixtures/singer.py index 4648b33..634818b 100644 --- a/tests/fixtures/singer.py +++ b/tests/fixtures/singer.py @@ -3,21 +3,14 @@ from elx.singer import Singer -@pytest.fixture(params=["tap-smoke-test", None]) +@pytest.fixture(params=["tap-mock-fixture", None]) def singer(request) -> Generator[Singer, None, None]: """ - Return a Singer instance for the tap-smoke-test executable. + Return a Singer instance for the tap-mock-fixture executable. """ yield Singer( # Test with and without an executable. executable=request.param, - spec="git+https://github.com/meltano/tap-smoke-test.git", - config={ - "streams": [ - { - "stream_name": "users", - "input_filename": "https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl", - }, - ], - }, + spec="git+https://github.com/quantile-taps/tap-mock-fixture.git", + config={}, ) From d07f81324a54945aefc9bb56224100bddb8a5791 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:43:17 +0100 Subject: [PATCH 11/13] Update default catalog and adjust tests --- tests/test_elx/test_catalog.py | 83 ++++++++++++++-------------------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/tests/test_elx/test_catalog.py b/tests/test_elx/test_catalog.py index 982e03e..90e3792 100644 --- a/tests/test_elx/test_catalog.py +++ b/tests/test_elx/test_catalog.py @@ -7,73 +7,54 @@ { "tap_stream_id": "animals", "replication_method": "FULL_TABLE", + "key_properties": ["id"], "replication_key": None, - "table_name": None, "is_view": False, - "key_properties": [], + "table_name": None, "schema": { "properties": { - "id": {"type": "integer"}, - "description": {"type": "string"}, - "verified": {"type": "boolean"}, - "views": {"type": "integer"}, - "created_at": {"type": "string"}, + "id": {"type": ["integer", "null"]}, + "animal_name": {"type": ["string", "null"]}, + "updated_at": {"format": "date-time", "type": ["string", "null"]}, }, "type": "object", - "required": ["created_at", "description", "id", "verified", "views"], }, "metadata": [ { "breadcrumb": ["properties", "id"], - "metadata": {"inclusion": "available"}, - }, - { - "breadcrumb": ["properties", "description"], - "metadata": {"inclusion": "available"}, - }, - { - "breadcrumb": ["properties", "verified"], - "metadata": {"inclusion": "available"}, + "metadata": {"inclusion": "automatic"}, }, { - "breadcrumb": ["properties", "views"], + "breadcrumb": ["properties", "animal_name"], "metadata": {"inclusion": "available"}, }, { - "breadcrumb": ["properties", "created_at"], + "breadcrumb": ["properties", "updated_at"], "metadata": {"inclusion": "available"}, }, { "breadcrumb": [], "metadata": { "inclusion": "available", - "selected": True, - "selected-by-default": True, - "table-key-properties": [], + "selected": False, + "selected-by-default": False, + "table-key-properties": ["id"], }, }, ], - } - ] -} - -INCREMENTAL_CATALOG = { - "streams": [ + }, { "tap_stream_id": "users", - "replication_method": "INCREMENTAL", "replication_key": "updated_at", - "table_name": None, + "replication_method": "INCREMENTAL", "is_view": False, + "table_name": None, "key_properties": ["id"], "schema": { "properties": { - "id": {"type": ["string", "null"]}, + "id": {"type": ["integer", "null"]}, "name": {"type": ["string", "null"]}, - "updated_at": { - "format": "date-time", - "type": ["string", "null"], - }, + "updated_at": {"format": "date-time", "type": ["string", "null"]}, }, "type": "object", }, @@ -101,7 +82,7 @@ }, }, ], - } + }, ] } @@ -132,9 +113,9 @@ def test_catalog_no_deselect(tap: Tap): def test_catalog_deselect_stream(tap: Tap): """If we deselect a stream, the catalog should be updated.""" - catalog = tap.catalog.deselect(["animals"]) + catalog = tap.catalog.deselect(["users"]) - assert catalog.streams[0].is_selected == False + assert catalog.streams[1].is_selected == False def test_catalog_deselect_invalid_stream(tap: Tap): @@ -151,27 +132,29 @@ def test_catalog_deselect_property(tap: Tap): assert catalog_dict["streams"][0]["metadata"][0]["metadata"]["selected"] == False -def test_catalog_replication_method(tap_incremental: Tap): +def test_catalog_replication_method(tap: Tap): """If we have an incremental stream, the replication_method in the catalog should be `INCREMENTAL`.""" - catalog_dict = tap_incremental.catalog.dict(by_alias=True) + catalog_dict = tap.catalog.dict(by_alias=True) assert ( - catalog_dict["streams"][0]["replication_method"] - == INCREMENTAL_CATALOG["streams"][0]["replication_method"] + catalog_dict["streams"][1]["replication_method"] + == DEFAULT_CATALOG["streams"][1]["replication_method"] ) -def test_catalog_replication_key(tap_incremental: Tap): +def test_catalog_replication_key(tap: Tap): """If we have an incremental stream, the catalog should have a `replication_key`.""" - catalog_dict = tap_incremental.catalog.dict(by_alias=True) + catalog_dict = tap.catalog.dict(by_alias=True) + + assert catalog_dict["streams"][1]["replication_key"] != None assert ( - catalog_dict["streams"][0]["replication_key"] - == INCREMENTAL_CATALOG["streams"][0]["replication_key"] + catalog_dict["streams"][1]["replication_key"] + == DEFAULT_CATALOG["streams"][1]["replication_key"] ) -def test_catalog_valid_replication_keys(tap_incremental: Tap): +def test_catalog_valid_replication_keys(tap: Tap): """ If we have an incremental stream, the catalog should have a metadata breadcrumb for the incremental stream containing the key: `valid-replication-keys`. @@ -187,11 +170,11 @@ def test_catalog_valid_replication_keys(tap_incremental: Tap): "valid-replication-keys": ["updated_at"], } """ - catalog_dict = tap_incremental.catalog.dict(by_alias=True) + catalog_dict = tap.catalog.dict(by_alias=True) - replication_keys = catalog_dict["streams"][0]["metadata"][-1]["metadata"].get( + replication_keys = catalog_dict["streams"][1]["metadata"][-1]["metadata"].get( "valid-replication-keys", None ) # Checks that value of `valid-replication-keys` equals to the replication-key - assert replication_keys == [INCREMENTAL_CATALOG["streams"][0]["replication_key"]] + assert replication_keys == [DEFAULT_CATALOG["streams"][1]["replication_key"]] From b026e77fdc7704c8133691a08b83d6c56a193646 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:44:12 +0100 Subject: [PATCH 12/13] Fix tests due to updated fixtures --- tests/test_elx/test_runner.py | 4 ++-- tests/test_elx/test_singer.py | 12 ++++++------ tests/test_elx/test_tap.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_elx/test_runner.py b/tests/test_elx/test_runner.py index 69e62de..27ee397 100644 --- a/tests/test_elx/test_runner.py +++ b/tests/test_elx/test_runner.py @@ -22,7 +22,7 @@ def test_config_interpolation_values(runner: Runner): """ Make sure the tap and target names are correct. """ - assert runner.interpolation_values["TAP_EXECUTABLE"] == "tap-smoke-test" + assert runner.interpolation_values["TAP_EXECUTABLE"] == "tap-mock-fixture" assert runner.interpolation_values["TARGET_EXECUTABLE"] == "target-jsonl" @@ -39,4 +39,4 @@ def test_config_interpolation_target_values(tap: Tap): runner = Runner(tap, target) - assert runner.target.config["tap_name"] == "tap_smoke_test" + assert runner.target.config["tap_name"] == "tap_mock_fixture" diff --git a/tests/test_elx/test_singer.py b/tests/test_elx/test_singer.py index 234301e..eb9a082 100644 --- a/tests/test_elx/test_singer.py +++ b/tests/test_elx/test_singer.py @@ -28,7 +28,7 @@ def test_singer_can_discover_executable(singer: Singer): """ Test that the singer executable can be discovered. """ - assert singer.executable == "tap-smoke-test" + assert singer.executable == "tap-mock-fixture" def test_singer_can_install(singer: Singer): @@ -71,8 +71,8 @@ def test_singer_dynamic_config(): Make sure the Singer instance is able to handle dynamic config. """ singer = Singer( - executable="tap-smoke-test", - spec="git+https://github.com/meltano/tap-smoke-test.git", + executable="tap-mock-fixture", + spec="git+https://github.com/quantile-taps/tap-mock-fixture.git", config=lambda: {}, ) @@ -84,8 +84,8 @@ def test_singer_config_interpolation(runner: Runner): Make sure the Singer instance is able to handle config interpolation. """ singer = Singer( - executable="tap-smoke-test", - spec="git+https://github.com/meltano/tap-smoke-test.git", + executable="tap-mock-fixture", + spec="git+https://github.com/quantile-taps/tap-mock-fixture.git", config={ "target_schema": "{TAP_NAME}", }, @@ -94,4 +94,4 @@ def test_singer_config_interpolation(runner: Runner): # Attach the runner singer.runner = runner - assert singer.config == {"target_schema": "tap_smoke_test"} + assert singer.config == {"target_schema": "tap_mock_fixture"} diff --git a/tests/test_elx/test_tap.py b/tests/test_elx/test_tap.py index 95dfe77..461087f 100644 --- a/tests/test_elx/test_tap.py +++ b/tests/test_elx/test_tap.py @@ -11,7 +11,7 @@ def test_tap_discovery(tap: Tap): # Make sure the catalog is of the right type. assert type(tap.catalog) == Catalog # Make sure the catalog has the right number of streams. - assert len(tap.catalog.streams) == 1 + assert len(tap.catalog.streams) == 2 # Make sure the streams are of the right type. assert type(tap.catalog.streams[0]) == Stream From 29a2f394601df8efd816a418373419dd28e6baf9 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Tue, 21 Nov 2023 18:45:02 +0100 Subject: [PATCH 13/13] Update asset loading test --- .../test_extensions/test_dagster/test_assets.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/test_elx/test_extensions/test_dagster/test_assets.py b/tests/test_elx/test_extensions/test_dagster/test_assets.py index f4d0526..251204f 100644 --- a/tests/test_elx/test_extensions/test_dagster/test_assets.py +++ b/tests/test_elx/test_extensions/test_dagster/test_assets.py @@ -7,18 +7,12 @@ def test_asset_loading(runner: Runner): """ Test that assets are loaded correctly. """ - assets = load_assets(runner) - assert len(assets) == 1 - assert isinstance(assets[0], AssetsDefinition) - + # Verifies that the tap associated with the runner has 2 streams + assert len(runner.tap.catalog.streams) == 2 -def test_asset_loading_with_deselected_stream(runner_with_deselected_stream: Runner): - """ - Test that assets are loaded correctly. - """ - # Verifies that the associated tap has multiple streams - assert len(runner_with_deselected_stream.tap.catalog.streams) == 2 + # Load assets + assets = load_assets(runner) - assets = load_assets(runner_with_deselected_stream) + # Length of assets should be 1 as one stream is deselected per default assert len(assets) == 1 assert isinstance(assets[0], AssetsDefinition)