Skip to content

Commit

Permalink
Move api_key and api_secret mocks to conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Nov 11, 2024
1 parent 74d1b58 commit 1bfd122
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Iterator
import uuid

import pytest
import responses
Expand Down Expand Up @@ -381,6 +382,16 @@
}


@pytest.fixture(name="api_key")
def api_key_fixture() -> str:
return uuid.uuid4().hex


@pytest.fixture(name="api_secret")
def api_secret_fixture() -> str:
return uuid.uuid4().hex


@pytest.fixture(name="connector_id")
def connector_id_fixture() -> str:
return "connector_id"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import uuid

import responses
from dagster_fivetran import FivetranWorkspace


def test_fetch_fivetran_workspace_data(
api_key: str,
api_secret: str,
fetch_workspace_data_api_mocks: responses.RequestsMock,
) -> None:
api_key = uuid.uuid4().hex
api_secret = uuid.uuid4().hex

resource = FivetranWorkspace(api_key=api_key, api_secret=api_secret)

actual_workspace_data = resource.fetch_fivetran_workspace_data()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import uuid

import responses
from dagster_fivetran import FivetranWorkspace


def test_basic_resource_request(
api_key: str,
api_secret: str,
connector_id: str,
destination_id: str,
group_id: str,
all_api_mocks: responses.RequestsMock,
) -> None:
api_key = uuid.uuid4().hex
api_secret = uuid.uuid4().hex

resource = FivetranWorkspace(api_key=api_key, api_secret=api_secret)

client = resource.get_client()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import uuid
from typing import Callable

from dagster_fivetran import FivetranWorkspace


def test_fivetran_workspace_data_to_fivetran_connector_table_props_data(
api_key: str,
api_secret: str,
fetch_workspace_data_api_mocks: Callable,
) -> None:
api_key = uuid.uuid4().hex
api_secret = uuid.uuid4().hex

resource = FivetranWorkspace(api_key=api_key, api_secret=api_secret)

actual_workspace_data = resource.fetch_fivetran_workspace_data()
Expand Down

0 comments on commit 1bfd122

Please sign in to comment.