Skip to content

Commit 45a32be

Browse files
simplify test
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 53bf715 commit 45a32be

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

tests/unit/test_thrift_backend.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_bad_protocol_versions_are_rejected(self, tcli_service_client_cass):
184184
)
185185

186186
with self.assertRaises(OperationalError) as cm:
187-
thrift_backend = self._create_mocked_thrift_client()
187+
thrift_backend = self._create_thrift_client()
188188
thrift_backend.open_session({}, None, None)
189189

190190
self.assertIn(
@@ -207,7 +207,7 @@ def test_okay_protocol_versions_succeed(self, tcli_service_client_cass):
207207
sessionHandle=self.session_handle,
208208
)
209209

210-
thrift_backend = self._create_mocked_thrift_client()
210+
thrift_backend = self._create_thrift_client()
211211
thrift_backend.open_session({}, None, None)
212212

213213
@patch("databricks.sql.auth.thrift_http_client.THttpClient")
@@ -918,21 +918,12 @@ def test_handle_execute_response_can_handle_with_direct_results(self):
918918
)
919919

920920
thrift_backend = self._create_mocked_thrift_client()
921-
mock_execute_response = Mock(spec=ExecuteResponse)
922-
mock_has_more_rows = True
923-
thrift_backend._results_message_to_execute_response = Mock(
924-
return_value=(mock_execute_response, mock_has_more_rows)
925-
)
926921

927-
result = thrift_backend._handle_execute_response(execute_resp, Mock())
922+
thrift_backend._handle_execute_response(execute_resp, Mock())
928923
thrift_backend._results_message_to_execute_response.assert_called_with(
929924
execute_resp,
930925
ttypes.TOperationState.FINISHED_STATE,
931926
)
932-
# Verify the result is a tuple with the expected values
933-
self.assertIsInstance(result, tuple)
934-
self.assertEqual(result[0], mock_execute_response)
935-
self.assertEqual(result[1], mock_has_more_rows)
936927

937928
@patch("databricks.sql.backend.thrift_backend.TCLIService.Client", autospec=True)
938929
def test_use_arrow_schema_if_available(self, tcli_service_class):

0 commit comments

Comments
 (0)