@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.poll_job_complete', side_effect=[False, True])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_client')
def test_cancel_queries(self, mock_client, mock_poll_job_complete):
    running_job_id = 3
    self.hook.running_job_id = running_job_id
    self.hook.cancel_query()
    mock_poll_job_complete.has_calls(mock.call(running_job_id), mock.call(running_job_id))
    mock_client.assert_called_once_with(project_id=PROJECT_ID, location=None)
    mock_client.return_value.cancel_job.assert_called_once_with(job_id=running_job_id)
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.poll_job_complete', side_effect=[False, True])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_client')
def test_cancel_queries(self, mock_client, mock_poll_job_complete):
    running_job_id = 3
    self.hook.running_job_id = running_job_id
    self.hook.cancel_query()
    mock_poll_job_complete.has_calls(mock.call(running_job_id), mock.call(running_job_id))
    mock_client.assert_called_once_with(project_id=PROJECT_ID, location=None)
    mock_client.return_value.cancel_job.assert_called_once_with(job_id=running_job_id)