Skip to content
Permalink
Browse files

Fix some deprecation warnings in test

  • Loading branch information
nyalldawson committed May 3, 2021
1 parent 3e3f169 commit 6cdbc6a9f494bfc141f4454bb0ba48de64b3fcde
Showing with 5 additions and 5 deletions.
  1. +5 −5 tests/src/python/test_provider_ogr_gpkg.py
@@ -828,11 +828,11 @@ def testExportLayerToExistingDatabase(self):
options['driverName'] = 'GPKG'
options['layerName'] = 'table1'
exporter = QgsVectorLayerExporter(tmpfile, "ogr", fields, QgsWkbTypes.Polygon,
QgsCoordinateReferenceSystem(3111), False, options)
QgsCoordinateReferenceSystem('EPSG:3111'), False, options)
self.assertFalse(exporter.errorCode(),
'unexpected export error {}: {}'.format(exporter.errorCode(), exporter.errorMessage()))
options['layerName'] = 'table2'
exporter = QgsVectorLayerExporter(tmpfile, "ogr", fields, QgsWkbTypes.Point, QgsCoordinateReferenceSystem(3113),
exporter = QgsVectorLayerExporter(tmpfile, "ogr", fields, QgsWkbTypes.Point, QgsCoordinateReferenceSystem('EPSG:3113'),
False, options)
self.assertFalse(exporter.errorCode(),
'unexpected export error {} : {}'.format(exporter.errorCode(), exporter.errorMessage()))
@@ -1356,7 +1356,7 @@ def testRegenerateFid(self):
options['driverName'] = 'GPKG'
options['layerName'] = 'table1'
exporter = QgsVectorLayerExporter(tmpfile, "ogr", fields, QgsWkbTypes.Polygon,
QgsCoordinateReferenceSystem(3111), False, options,
QgsCoordinateReferenceSystem('EPSG:3111'), False, options,
QgsFeatureSink.RegeneratePrimaryKey)
self.assertFalse(exporter.errorCode(),
'unexpected export error {}: {}'.format(exporter.errorCode(), exporter.errorMessage()))
@@ -1406,7 +1406,7 @@ def testExportWithoutFids(self):
options['update'] = True
options['driverName'] = 'GPKG'
options['layerName'] = 'output'
exporter = QgsVectorLayerExporter(tmpfile, "ogr", fields, QgsWkbTypes.Point, QgsCoordinateReferenceSystem(4326),
exporter = QgsVectorLayerExporter(tmpfile, "ogr", fields, QgsWkbTypes.Point, QgsCoordinateReferenceSystem('EPSG:4326'),
False, options, QgsFeatureSink.RegeneratePrimaryKey)
self.assertFalse(exporter.errorCode(),
'unexpected export error {}: {}'.format(exporter.errorCode(), exporter.errorMessage()))
@@ -1996,7 +1996,7 @@ def _testVectorLayerExporterDeferredSpatialIndex(self, layerOptions, expectSpati
if layerOptions:
options['layerOptions'] = layerOptions
exporter = QgsVectorLayerExporter(tmpfile, "ogr", QgsFields(), QgsWkbTypes.Polygon,
QgsCoordinateReferenceSystem(3111), False, options)
QgsCoordinateReferenceSystem('EPSG:3111'), False, options)
self.assertFalse(exporter.errorCode(),
'unexpected export error {}: {}'.format(exporter.errorCode(), exporter.errorMessage()))

0 comments on commit 6cdbc6a

Please sign in to comment.