@@ -612,9 +612,9 @@ def mock_close_normal():
612612
613613 def test_resultset_close_handles_cursor_already_closed_error (self ):
614614 """Test that ResultSet.close() handles CursorAlreadyClosedError properly."""
615- result_set = client .ResultSet .__new__ (client .ResultSet )
616- result_set .thrift_backend = Mock ()
617- result_set .thrift_backend .CLOSED_OP_STATE = 'CLOSED'
615+ result_set = client .ThriftResultSet .__new__ (client .ThriftResultSet )
616+ result_set .backend = Mock ()
617+ result_set .backend .CLOSED_OP_STATE = 'CLOSED'
618618 result_set .connection = Mock ()
619619 result_set .connection .open = True
620620 result_set .op_state = 'RUNNING'
@@ -625,29 +625,29 @@ class MockRequestError(Exception):
625625 def __init__ (self ):
626626 self .args = ["Error message" , CursorAlreadyClosedError ()]
627627
628- result_set .thrift_backend .close_command .side_effect = MockRequestError ()
628+ result_set .backend .close_command .side_effect = MockRequestError ()
629629
630630 original_close = client .ResultSet .close
631631 try :
632632 try :
633633 if (
634- result_set .op_state != result_set .thrift_backend .CLOSED_OP_STATE
634+ result_set .op_state != result_set .backend .CLOSED_OP_STATE
635635 and not result_set .has_been_closed_server_side
636636 and result_set .connection .open
637637 ):
638- result_set .thrift_backend .close_command (result_set .command_id )
638+ result_set .backend .close_command (result_set .command_id )
639639 except MockRequestError as e :
640640 if isinstance (e .args [1 ], CursorAlreadyClosedError ):
641641 pass
642642 finally :
643643 result_set .has_been_closed_server_side = True
644- result_set .op_state = result_set .thrift_backend .CLOSED_OP_STATE
644+ result_set .op_state = result_set .backend .CLOSED_OP_STATE
645645
646- result_set .thrift_backend .close_command .assert_called_once_with (result_set .command_id )
646+ result_set .backend .close_command .assert_called_once_with (result_set .command_id )
647647
648648 assert result_set .has_been_closed_server_side is True
649649
650- assert result_set .op_state == result_set .thrift_backend .CLOSED_OP_STATE
650+ assert result_set .op_state == result_set .backend .CLOSED_OP_STATE
651651 finally :
652652 pass
653653
0 commit comments