@patch.object(GeoRaster2, 'get_window')
def test_crop_use_get_window_for_a_not_loaded_image(self, mock_get_window):
    coords = mercantile.xy_bounds(*tiles[15])
    shape = GeoVector(Polygon.from_bounds(*coords), WEB_MERCATOR_CRS)
    raster = self.read_only_virtual_geo_raster()
    with NamedTemporaryFile(mode='w+b', suffix='.tif') as rf:
        raster.save(rf.name)
        raster = GeoRaster2.open(rf.name)
        raster.crop(shape, MERCATOR_RESOLUTION_MAPPING[15])
        assert mock_get_window.called_once
@patch.object(GeoRaster2, 'get_window')
def test_crop_use_get_window_for_a_not_loaded_image(self, mock_get_window):
    coords = mercantile.xy_bounds(*tiles[15])
    shape = GeoVector(Polygon.from_bounds(*coords), WEB_MERCATOR_CRS)
    raster = self.read_only_virtual_geo_raster()
    with NamedTemporaryFile(mode='w+b', suffix='.tif') as rf:
        raster.save(rf.name)
        raster = GeoRaster2.open(rf.name)
        raster.crop(shape, MERCATOR_RESOLUTION_MAPPING[15])
        assert mock_get_window.called_once