Skip to content

Commit 2be0c86

Browse files
make mock result set be of type SeaResultSet
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 1d515e3 commit 2be0c86

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/unit/test_sea_backend.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
_filter_session_configuration,
1414
)
1515
from databricks.sql.backend.sea.models.base import ServiceError, StatementStatus
16+
from databricks.sql.backend.sea.result_set import SeaResultSet
1617
from databricks.sql.backend.types import SessionId, CommandId, CommandState, BackendType
1718
from databricks.sql.parameters.native import IntegerParameter, TDbsqlParameter
1819
from databricks.sql.thrift_api.TCLIService import ttypes
@@ -703,7 +704,7 @@ def test_results_message_to_execute_response_is_staging_operation(self, sea_clie
703704
def test_get_catalogs(self, sea_client, sea_session_id, mock_cursor):
704705
"""Test the get_catalogs method."""
705706
# Mock the execute_command method
706-
mock_result_set = Mock()
707+
mock_result_set = Mock(spec=SeaResultSet)
707708
with patch.object(
708709
sea_client, "execute_command", return_value=mock_result_set
709710
) as mock_execute:
@@ -735,7 +736,7 @@ def test_get_catalogs(self, sea_client, sea_session_id, mock_cursor):
735736
def test_get_schemas(self, sea_client, sea_session_id, mock_cursor):
736737
"""Test the get_schemas method with various parameter combinations."""
737738
# Mock the execute_command method
738-
mock_result_set = Mock()
739+
mock_result_set = Mock(spec=SeaResultSet)
739740
with patch.object(
740741
sea_client, "execute_command", return_value=mock_result_set
741742
) as mock_execute:
@@ -884,7 +885,7 @@ def test_get_tables(self, sea_client, sea_session_id, mock_cursor):
884885
def test_get_columns(self, sea_client, sea_session_id, mock_cursor):
885886
"""Test the get_columns method with various parameter combinations."""
886887
# Mock the execute_command method
887-
mock_result_set = Mock()
888+
mock_result_set = Mock(spec=SeaResultSet)
888889
with patch.object(
889890
sea_client, "execute_command", return_value=mock_result_set
890891
) as mock_execute:

0 commit comments

Comments
 (0)