@@ -334,30 +334,30 @@ def test_execute_parameter_passthrough(self):
334
334
expected_query ,
335
335
)
336
336
337
- @patch ("%s.client.ThriftDatabricksClient" % PACKAGE_NAME )
338
337
@patch ("%s.client.ResultSet" % PACKAGE_NAME )
339
338
def test_executemany_parameter_passhthrough_and_uses_last_result_set (
340
- self , mock_result_set_class , mock_thrift_backend
339
+ self , mock_result_set_class
341
340
):
342
341
# Create a new mock result set each time the class is instantiated
343
342
mock_result_set_instances = [Mock (), Mock (), Mock ()]
344
343
mock_result_set_class .side_effect = mock_result_set_instances
345
344
mock_backend = ThriftDatabricksClientMockFactory .new ()
346
- cursor = client .Cursor (Mock (), mock_backend ())
345
+
346
+ cursor = client .Cursor (Mock (), mock_backend )
347
347
348
348
params = [{"x" : None }, {"x" : "foo1" }, {"x" : "bar2" }]
349
349
expected_queries = ["SELECT NULL" , "SELECT 'foo1'" , "SELECT 'bar2'" ]
350
350
351
351
cursor .executemany ("SELECT %(x)s" , seq_of_parameters = params )
352
352
353
353
self .assertEqual (
354
- len (mock_thrift_backend .execute_command .call_args_list ),
354
+ len (mock_backend .execute_command .call_args_list ),
355
355
len (expected_queries ),
356
356
"Expected execute_command to be called the same number of times as params were passed" ,
357
357
)
358
358
359
359
for expected_query , call_args in zip (
360
- expected_queries , mock_thrift_backend .execute_command .call_args_list
360
+ expected_queries , mock_backend .execute_command .call_args_list
361
361
):
362
362
self .assertEqual (call_args [1 ]["operation" ], expected_query )
363
363
0 commit comments