Skip to content
Permalink
Browse files

Fix a test on proj 6+

  • Loading branch information
nyalldawson committed May 13, 2020
1 parent a3cffc8 commit 46682d0690eef7e69f0fe1c7bda10bb9d38e001c
Showing with 4 additions and 5 deletions.
  1. +4 −5 tests/src/python/test_qgsvectorlayer.py
@@ -350,20 +350,19 @@ def testSetDataSource(self):
self.assertEqual(layer.renderer(), r)

# layer with different type
lines_path = os.path.join(unitTestDataPath(), 'lines.shp')
lines_path = os.path.join(unitTestDataPath(), 'rectangles.shp')
layer.setDataSource(lines_path, 'new name2', 'ogr', options)

self.assertTrue(layer.isValid())
self.assertEqual(layer.name(), 'new name2')
self.assertEqual(layer.wkbType(), QgsWkbTypes.MultiLineString)
# depending on proj version, the projection for this layer is either 4326 or 4030
self.assertIn(layer.crs().authid(), ('EPSG:4326', 'EPSG:4030'))
self.assertEqual(layer.wkbType(), QgsWkbTypes.MultiPolygon)
self.assertEqual(layer.crs().authid(), 'EPSG:4326')
self.assertIn(lines_path, layer.dataProvider().dataSourceUri())
self.assertEqual(len(spy), 2)

# should have reset renderer!
self.assertNotEqual(layer.renderer(), r)
self.assertEqual(layer.renderer().symbol().type(), QgsSymbol.Line)
self.assertEqual(layer.renderer().symbol().type(), QgsSymbol.Fill)

def testSetDataSourceInvalidToValid(self):
"""

0 comments on commit 46682d0

Please sign in to comment.
You can’t perform that action at this time.