Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a test on proj 6+
  • Loading branch information
nyalldawson committed May 14, 2020
1 parent a3cffc8 commit 46682d0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/src/python/test_qgsvectorlayer.py
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 46682d0

Please sign in to comment.