From d0b746ed95ebe56b53a63eb294a45f05a6668156 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Fri, 15 Nov 2024 09:40:12 -0500 Subject: [PATCH] Add comments in test --- .../experimental/test_resources.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py index 1e73d8535a224..ff77c6e46d0de 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py @@ -19,8 +19,9 @@ def test_basic_resource_request( resource = FivetranWorkspace( account_id=TEST_ACCOUNT_ID, api_key=TEST_API_KEY, api_secret=TEST_API_SECRET ) - client = resource.get_client() + + # fetch workspace data calls client.get_connectors_for_group(group_id=group_id) client.get_destination_details(destination_id=destination_id) client.get_groups() @@ -33,7 +34,7 @@ def test_basic_resource_request( assert "groups" in all_api_mocks.calls[2].request.url assert f"{connector_id}/schemas" in all_api_mocks.calls[3].request.url - # reset calls + # connector details calls all_api_mocks.calls.reset() client.get_connector_details(connector_id=connector_id) client.update_schedule_type_for_connector(connector_id=connector_id, schedule_type="auto") @@ -43,21 +44,25 @@ def test_basic_resource_request( assert connector_id in all_api_mocks.calls[1].request.url assert all_api_mocks.calls[1].request.method == "PATCH" + # sync calls all_api_mocks.calls.reset() client.start_sync(connector_id=connector_id) assert len(all_api_mocks.calls) == 3 assert f"{connector_id}/force" in all_api_mocks.calls[2].request.url + # resync calls all_api_mocks.calls.reset() client.start_resync(connector_id=connector_id, resync_parameters=None) assert len(all_api_mocks.calls) == 3 assert f"{connector_id}/resync" in all_api_mocks.calls[2].request.url + # resync calls with parameters all_api_mocks.calls.reset() client.start_resync(connector_id=connector_id, resync_parameters={"property1": ["string"]}) assert len(all_api_mocks.calls) == 3 assert f"{connector_id}/schemas/tables/resync" in all_api_mocks.calls[2].request.url + # poll calls all_api_mocks.calls.reset() client.poll_sync( connector_id=connector_id, previous_sync_completed_at=parser.parse(MIN_TIME_STR)