chore(OAuth2): refactor for custom OAuth2 clients (#27880)

This commit is contained in:
Beto Dealmeida
2024-04-05 12:17:39 -04:00
committed by GitHub
parent 62433c14a7
commit 9377227e06
22 changed files with 385 additions and 297 deletions

View File

@@ -62,12 +62,13 @@ def test_execute_connection_error() -> None:
from superset.db_engine_specs.databend import DatabendEngineSpec
from superset.db_engine_specs.exceptions import SupersetDBAPIDatabaseError
database = Mock()
cursor = Mock()
cursor.execute.side_effect = NewConnectionError(
HTTPConnection("Dummypool"), "Exception with sensitive data"
)
with pytest.raises(SupersetDBAPIDatabaseError) as excinfo:
DatabendEngineSpec.execute(cursor, "SELECT col1 from table1", 1)
DatabendEngineSpec.execute(cursor, "SELECT col1 from table1", database)
assert str(excinfo.value) == "Connection failed"