-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(connectors): BI-5777 handle google api errors & bad creds error i…
…n BQ connector (#601) * fix(connectors) BI-5777 handle google api errors & bad creds error in BQ connector * remove debug print (shame on me)
- Loading branch information
1 parent
d467d40
commit 3e78eff
Showing
7 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 35 additions & 1 deletion
36
lib/dl_connector_bigquery/dl_connector_bigquery_tests/ext/api/test_connection.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
from typing import Optional | ||
|
||
from dl_api_client.dsmaker.api.http_sync_base import SyncHttpClientBase | ||
from dl_api_lib_testing.connection_base import ConnectionTestBase | ||
from dl_api_lib_testing.connector.connection_suite import DefaultConnectorConnectionTestSuite | ||
from dl_testing.regulated_test import RegulatedTestCase | ||
|
||
from dl_connector_bigquery_tests.ext.api.base import BigQueryConnectionTestBase | ||
from dl_connector_bigquery_tests.ext.api.base import ( | ||
BigQueryConnectionTestBadProjectId, | ||
BigQueryConnectionTestBase, | ||
BigQueryConnectionTestMalformedCreds, | ||
) | ||
|
||
|
||
class TestBigQueryConnection(BigQueryConnectionTestBase, DefaultConnectorConnectionTestSuite): | ||
pass | ||
|
||
|
||
class ErrorHandlingTestBase(BigQueryConnectionTestBase, ConnectionTestBase, RegulatedTestCase): | ||
def test_connection_sources_error( | ||
self, | ||
control_api_sync_client: SyncHttpClientBase, | ||
saved_connection_id: str, | ||
bi_headers: Optional[dict[str, str]], | ||
) -> None: | ||
resp = control_api_sync_client.get( | ||
url=f"/api/v1/connections/{saved_connection_id}/info/sources", | ||
headers=bi_headers, | ||
) | ||
assert resp.status_code == 400, resp.json | ||
resp_data = resp.json | ||
assert "code" in resp_data, resp_data | ||
assert "message" in resp_data, resp_data | ||
|
||
|
||
class TestErrorHandlingMalformedCreds(BigQueryConnectionTestMalformedCreds, ErrorHandlingTestBase): | ||
pass | ||
|
||
|
||
class TestErrorHandlingBadProjectId(BigQueryConnectionTestBadProjectId, ErrorHandlingTestBase): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters