Skip to content

Commit

Permalink
use temporary auth db for test
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros committed Jul 10, 2024
1 parent bf9190f commit 54b9883
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/src/python/test_processing_algs_gdal_gdalutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,31 @@
__copyright__ = 'Copyright 2024, The QGIS Project'


import os
import tempfile
from shutil import rmtree

import unittest
from qgis.testing import start_app, QgisTestCase
from qgis.core import QgsApplication, QgsRasterLayer, QgsDataSourceUri, QgsAuthMethodConfig
from processing.algs.gdal.GdalUtils import GdalUtils


QGIS_AUTH_DB_DIR_PATH = tempfile.mkdtemp()
os.environ['QGIS_AUTH_DB_DIR_PATH'] = QGIS_AUTH_DB_DIR_PATH

start_app()


class TestProcessingAlgsGdalGdalUtils(QgisTestCase):

@classmethod
def tearDownClass(cls):
"""Run after all tests"""
rmtree(QGIS_AUTH_DB_DIR_PATH)
del os.environ['QGIS_AUTH_DB_DIR_PATH']
super().tearDownClass()

def testGdalSourceFromLayer(self):
"""
Test GdalUtils.gdalSourceFromLayer
Expand Down

0 comments on commit 54b9883

Please sign in to comment.