code: def test_build_overviews_new_file(tmpdir, path_rgb_byte_tif):
      """Confirm fix of #1497"""
      dst_file = str(tmpdir.join("test.tif"))
      with rasterio.open(path_rgb_byte_tif) as src:
          with rasterio.open(dst_file, "w", **src.profile) as dst:
              dst.write(src.read())
              overview_factors = [2, 4]
              dst.build_overviews(
                  overview_factors,
                  resampling=OverviewResampling.nearest,
              )
  
      with rasterio.open(dst_file, overview_level=1) as src:
          data = src.read()
          assert data.any()
  
file_path: rasterio/tests/test_overviews.py
imports: import numpy
  import pytest
  from .conftest import requires_gdal33
  import rasterio
  from rasterio.enums import _OverviewResampling
  from rasterio.enums import Resampling
  from rasterio.errors import OverviewCreationError
label_desc: Use image node_id 9 for calling a global function with example usage: test_build_overviews_new_file(tmpdir, path_rgb_byte_tif) without return types