Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Nov 12, 2024
1 parent 58eff95 commit 86853f1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
},
}

TEST_ACCOUNT_ID = "test_account_id"
TEST_API_KEY = "test_api_key"
TEST_API_SECRET = "test_api_secret"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import responses
from dagster_fivetran import FivetranWorkspace

from dagster_fivetran_tests.experimental.conftest import TEST_API_KEY, TEST_API_SECRET
from dagster_fivetran_tests.experimental.conftest import (
TEST_ACCOUNT_ID,
TEST_API_KEY,
TEST_API_SECRET,
)


def test_fetch_fivetran_workspace_data(
fetch_workspace_data_api_mocks: responses.RequestsMock,
) -> None:
resource = FivetranWorkspace(api_key=TEST_API_KEY, api_secret=TEST_API_SECRET)
resource = FivetranWorkspace(
account_id=TEST_ACCOUNT_ID, api_key=TEST_API_KEY, api_secret=TEST_API_SECRET
)

actual_workspace_data = resource.fetch_fivetran_workspace_data()
assert len(actual_workspace_data.connectors_by_id) == 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import responses
from dagster_fivetran import FivetranWorkspace

from dagster_fivetran_tests.experimental.conftest import TEST_API_KEY, TEST_API_SECRET
from dagster_fivetran_tests.experimental.conftest import (
TEST_ACCOUNT_ID,
TEST_API_KEY,
TEST_API_SECRET,
)


def test_basic_resource_request(
Expand All @@ -10,7 +14,9 @@ def test_basic_resource_request(
group_id: str,
all_api_mocks: responses.RequestsMock,
) -> None:
resource = FivetranWorkspace(api_key=TEST_API_KEY, api_secret=TEST_API_SECRET)
resource = FivetranWorkspace(
account_id=TEST_ACCOUNT_ID, api_key=TEST_API_KEY, api_secret=TEST_API_SECRET
)

client = resource.get_client()
client.get_connector_details(connector_id=connector_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

from dagster_fivetran import FivetranWorkspace

from dagster_fivetran_tests.experimental.conftest import TEST_API_KEY, TEST_API_SECRET
from dagster_fivetran_tests.experimental.conftest import (
TEST_ACCOUNT_ID,
TEST_API_KEY,
TEST_API_SECRET,
)


def test_fivetran_workspace_data_to_fivetran_connector_table_props_data(
fetch_workspace_data_api_mocks: Callable,
) -> None:
resource = FivetranWorkspace(api_key=TEST_API_KEY, api_secret=TEST_API_SECRET)
resource = FivetranWorkspace(
account_id=TEST_ACCOUNT_ID, api_key=TEST_API_KEY, api_secret=TEST_API_SECRET
)

actual_workspace_data = resource.fetch_fivetran_workspace_data()
table_props_data = actual_workspace_data.to_fivetran_connector_table_props_data()
Expand Down

0 comments on commit 86853f1

Please sign in to comment.