Skip to content

Commit

Permalink
#1347 source amplitude: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov-d committed Jan 27, 2023
1 parent 0200b78 commit bc671b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
#


def test_dummy_test():
assert True
import pytest

pytest_plugins = ("source_acceptance_test.plugin",)


@pytest.fixture(scope="session", autouse=True)
def connector_setup():
"""This fixture is a placeholder for external resources that acceptance test might require."""
# TODO: setup test dependencies if needed. otherwise remove the TODO comments
yield
# TODO: clean up test dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _convert_auth_to_token(self, username: str, password: str) -> str:
def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, any]:
try:
auth = TokenAuthenticator(token=self._convert_auth_to_token(config["api_key"], config["secret_key"]), auth_method="Basic")
list(Cohorts(authenticator=auth, data_region=config["data_region"]).read_records(SyncMode.full_refresh))
list(Cohorts(authenticator=auth, data_region=config.get("data_region", "Standard Server")).read_records(SyncMode.full_refresh))
return True, None
except Exception as error:
return False, f"Unable to connect to Amplitude API with the provided credentials - {repr(error)}"
Expand Down

0 comments on commit bc671b4

Please sign in to comment.