@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
def test_flush_cursor(self, mock_get_service):
    bq_cursor = self.hook.get_cursor()
    bq_cursor.page_token = '456dcea9-fcbf-4f02-b570-83f5297c685e'
    bq_cursor.job_id = 'c0a79ae4-0e72-4593-a0d0-7dbbf726f193'
    bq_cursor.all_pages_loaded = True
    bq_cursor.buffer = [('a', 100, 200), ('b', 200, 300)]
    bq_cursor.flush_results()
    assert (bq_cursor.page_token is None)
    assert (bq_cursor.job_id is None)
    assert (not bq_cursor.all_pages_loaded)
    assert (bq_cursor.buffer == [])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
def test_flush_cursor(self, mock_get_service):
    bq_cursor = self.hook.get_cursor()
    bq_cursor.page_token = '456dcea9-fcbf-4f02-b570-83f5297c685e'
    bq_cursor.job_id = 'c0a79ae4-0e72-4593-a0d0-7dbbf726f193'
    bq_cursor.all_pages_loaded = True
    bq_cursor.buffer = [('a', 100, 200), ('b', 200, 300)]
    bq_cursor.flush_results()
    assert (bq_cursor.page_token is None)
    assert (bq_cursor.job_id is None)
    assert (not bq_cursor.all_pages_loaded)
    assert (bq_cursor.buffer == [])