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 authored and wonder-sk committed Jul 18, 2024
1 parent b137540 commit b304aeb
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,6 +10,10 @@
__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
Expand All @@ -18,11 +22,21 @@
GdalConnectionDetails
)

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 test_gdal_connection_details_from_layer_postgresraster(self):
"""
Test GdalUtils.gdal_connection_details_from_layer
Expand Down

0 comments on commit b304aeb

Please sign in to comment.