@@ -38,10 +38,6 @@ def new(cls):
38
38
cls .apply_property_to_mock (ThriftBackendMock , staging_allowed_local_path = None )
39
39
MockTExecuteStatementResp = MagicMock (spec = TExecuteStatementResp ())
40
40
41
- mock_retry_policy = Mock ()
42
- mock_retry_policy .history = []
43
- cls .apply_property_to_mock (ThriftBackendMock , retry_policy = mock_retry_policy )
44
-
45
41
cls .apply_property_to_mock (
46
42
MockTExecuteStatementResp ,
47
43
description = None ,
@@ -322,7 +318,7 @@ def test_executing_multiple_commands_uses_the_most_recent_command(
322
318
mock_result_sets [1 ].fetchall .assert_called_once_with ()
323
319
324
320
def test_closed_cursor_doesnt_allow_operations (self ):
325
- cursor = client .Cursor (Mock (), ThriftBackendMockFactory . new ())
321
+ cursor = client .Cursor (Mock (), Mock ())
326
322
cursor .close ()
327
323
328
324
with self .assertRaises (Error ) as e :
@@ -334,19 +330,14 @@ def test_closed_cursor_doesnt_allow_operations(self):
334
330
self .assertIn ("closed" , e .msg )
335
331
336
332
def test_negative_fetch_throws_exception (self ):
337
- mock_connection = Mock ()
338
- mock_connection .get_session_id_hex .return_value = "test_session"
339
- mock_execute_response = Mock ()
340
- mock_execute_response .command_handle = None
341
-
342
- result_set = client .ResultSet (mock_connection , mock_execute_response , ThriftBackendMockFactory .new ())
333
+ result_set = client .ResultSet (Mock (), Mock (), Mock ())
343
334
344
335
with self .assertRaises (ValueError ) as e :
345
336
result_set .fetchmany (- 1 )
346
337
347
338
def test_context_manager_closes_cursor (self ):
348
339
mock_close = Mock ()
349
- with client .Cursor (Mock (), ThriftBackendMockFactory . new ()) as cursor :
340
+ with client .Cursor (Mock (), Mock ()) as cursor :
350
341
cursor .close = mock_close
351
342
mock_close .assert_called_once_with ()
352
343
@@ -389,7 +380,7 @@ def test_get_schemas_parameters_passed_to_thrift_backend(self, mock_thrift_backe
389
380
for req_args in req_args_combinations :
390
381
req_args = {k : v for k , v in req_args .items () if v != "NOT_SET" }
391
382
with self .subTest (req_args = req_args ):
392
- mock_thrift_backend = ThriftBackendMockFactory . new ()
383
+ mock_thrift_backend = Mock ()
393
384
394
385
cursor = client .Cursor (Mock (), mock_thrift_backend )
395
386
cursor .schemas (** req_args )
@@ -412,7 +403,7 @@ def test_get_tables_parameters_passed_to_thrift_backend(self, mock_thrift_backen
412
403
for req_args in req_args_combinations :
413
404
req_args = {k : v for k , v in req_args .items () if v != "NOT_SET" }
414
405
with self .subTest (req_args = req_args ):
415
- mock_thrift_backend = ThriftBackendMockFactory . new ()
406
+ mock_thrift_backend = Mock ()
416
407
417
408
cursor = client .Cursor (Mock (), mock_thrift_backend )
418
409
cursor .tables (** req_args )
@@ -435,7 +426,7 @@ def test_get_columns_parameters_passed_to_thrift_backend(self, mock_thrift_backe
435
426
for req_args in req_args_combinations :
436
427
req_args = {k : v for k , v in req_args .items () if v != "NOT_SET" }
437
428
with self .subTest (req_args = req_args ):
438
- mock_thrift_backend = ThriftBackendMockFactory . new ()
429
+ mock_thrift_backend = Mock ()
439
430
440
431
cursor = client .Cursor (Mock (), mock_thrift_backend )
441
432
cursor .columns (** req_args )
0 commit comments