Skip to content
Permalink
Browse files
test_provider_gdal.py: fix testSanitizeVRT() (refs #49352 (comment))
  • Loading branch information
rouault authored and nyalldawson committed Aug 9, 2022
1 parent 3e7ceea commit 5590ff790aa3deb4ac340b68e8e6187111cf2770
Showing 1 changed file with 6 additions and 2 deletions.
@@ -178,9 +178,13 @@ def testSanitizeVRT(self):
"""Test qgsgdalprovider.cpp sanitizeVRTFile() / workaround for https://github.com/qgis/QGIS/issues/49285 """

tmp_dir = QTemporaryDir()
vrtfilename = os.path.join(tmp_dir.path(), 'out.vrt')
tmpfilename = os.path.join(tmp_dir.path(), 'tmp.tif')
path = os.path.join(unitTestDataPath(), 'landsat_4326.tif')
ds = gdal.BuildVRT(vrtfilename, [path])
tmp_ds = gdal.Translate(tmpfilename, path, options='-outsize 1024 0')
tmp_ds.BuildOverviews('NEAR', [2])
tmp_ds = None
vrtfilename = os.path.join(tmp_dir.path(), 'out.vrt')
ds = gdal.BuildVRT(vrtfilename, [tmpfilename])
ds = None
assert 'OverviewList' in open(vrtfilename, 'rt').read()

0 comments on commit 5590ff7

Please sign in to comment.