22from firebolt .client .auth import FireboltCore
33from sqlalchemy import create_engine , text
44from sqlalchemy .engine .base import Connection , Engine
5+ from sqlalchemy .exc import InterfaceError
56
67
78@pytest .mark .core
@@ -46,6 +47,9 @@ def test_core_sdk_validation_with_engine_name(self, core_url: str):
4647 assert result_dict ["database" ] == "test_db"
4748 assert result_dict ["url" ] == core_url
4849 assert isinstance (result_dict ["auth" ], FireboltCore )
50+ with pytest .raises (InterfaceError ) as exc_info :
51+ engine .connect ().execute (text ("SELECT 1" ))
52+ assert "Parameters 'engine_name' are not compatible" in str (exc_info .value )
4953
5054 def test_core_sdk_validation_with_account_name (self , core_url : str ):
5155 """Test that SDK handles account_name parameter for Core connections."""
@@ -60,6 +64,9 @@ def test_core_sdk_validation_with_account_name(self, core_url: str):
6064 assert result_dict ["database" ] == "test_db"
6165 assert result_dict ["url" ] == core_url
6266 assert isinstance (result_dict ["auth" ], FireboltCore )
67+ with pytest .raises (InterfaceError ) as exc_info :
68+ engine .connect ().execute (text ("SELECT 1" ))
69+ assert "Parameters 'account_name' are not compatible" in str (exc_info .value )
6370
6471 def test_core_sdk_validation_with_invalid_url (self , core_url : str ):
6572 """Test that SDK handles invalid URL parameter for Core connections."""
@@ -71,3 +78,6 @@ def test_core_sdk_validation_with_invalid_url(self, core_url: str):
7178 assert result_dict ["url" ] == "invalid://localhost:9999"
7279 assert result_dict ["database" ] == "test_db"
7380 assert isinstance (result_dict ["auth" ], FireboltCore )
81+ with pytest .raises (InterfaceError ) as exc_info :
82+ engine .connect ().execute (text ("SELECT 1" ))
83+ assert "Invalid protocol" in str (exc_info .value )
0 commit comments