@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryCursor.fetchone')
def test_fetchmany(self, mock_fetchone, mock_get_service):
    side_effect_values = [1, 2, 3, None]
    bq_cursor = self.hook.get_cursor()
    mock_fetchone.side_effect = side_effect_values
    result = bq_cursor.fetchmany()
    assert ([1] == result)
    mock_fetchone.side_effect = side_effect_values
    result = bq_cursor.fetchmany(2)
    assert ([1, 2] == result)
    mock_fetchone.side_effect = side_effect_values
    result = bq_cursor.fetchmany(5)
    assert ([1, 2, 3] == result)
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryCursor.fetchone')
def test_fetchmany(self, mock_fetchone, mock_get_service):
    side_effect_values = [1, 2, 3, None]
    bq_cursor = self.hook.get_cursor()
    mock_fetchone.side_effect = side_effect_values
    result = bq_cursor.fetchmany()
    assert ([1] == result)
    mock_fetchone.side_effect = side_effect_values
    result = bq_cursor.fetchmany(2)
    assert ([1, 2] == result)
    mock_fetchone.side_effect = side_effect_values
    result = bq_cursor.fetchmany(5)
    assert ([1, 2, 3] == result)