Skip to content

Commit

Permalink
Fix test for GDAL < 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 26, 2019
1 parent aa92ef3 commit 7744ee3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/src/python/test_qgsproviderconnection_postgres.py
Expand Up @@ -61,9 +61,11 @@ def test_postgis_connections_from_uri(self):

# Test raster
self.assertEqual(conn.tableUri('qgis_test', 'Raster1'),
'PG: dbname=\'qgis_test\' sslmode=disable mode=2 schema=\'qgis_test\' table=\'Raster1\' column=\'Rast\'')
rl = QgsRasterLayer(conn.tableUri('qgis_test', 'Raster1'), 'r1', 'gdal')
self.assertTrue(rl.isValid())
'PG: %s mode=2 schema=\'qgis_test\' table=\'Raster1\' column=\'Rast\'' % self.uri)

if (gdal.VersionInfo() >= '2040000'):
rl = QgsRasterLayer(conn.tableUri('qgis_test', 'Raster1'), 'r1', 'gdal')
self.assertTrue(rl.isValid())

def test_postgis_table_uri(self):
"""Create a connection from a layer uri and create a table URI"""
Expand Down

0 comments on commit 7744ee3

Please sign in to comment.