Skip to content
Permalink
Browse files

Update tests for OGR getLayers now returning also the geometry column…

… name
  • Loading branch information
elpaso committed Sep 8, 2017
1 parent 274cc6c commit 8abf6dc43ee8c5be657bd427225aa999f85e265f
Showing with 3 additions and 3 deletions.
  1. +2 −2 tests/src/python/test_provider_ogr.py
  2. +1 −1 tests/src/python/test_provider_ogr_gpkg.py
@@ -112,7 +112,7 @@ def testMixOfPolygonCurvePolygon(self):
vl = QgsVectorLayer('{}|layerid=0'.format(datasource), 'test', 'ogr')
self.assertTrue(vl.isValid())
self.assertEqual(len(vl.dataProvider().subLayers()), 1)
self.assertEqual(vl.dataProvider().subLayers()[0], '0:testMixOfPolygonCurvePolygon:4:CurvePolygon')
self.assertEqual(vl.dataProvider().subLayers()[0], '0:testMixOfPolygonCurvePolygon:4:CurvePolygon:')

def testMixOfLineStringCompoundCurve(self):

@@ -128,7 +128,7 @@ def testMixOfLineStringCompoundCurve(self):
vl = QgsVectorLayer('{}|layerid=0'.format(datasource), 'test', 'ogr')
self.assertTrue(vl.isValid())
self.assertEqual(len(vl.dataProvider().subLayers()), 1)
self.assertEqual(vl.dataProvider().subLayers()[0], '0:testMixOfLineStringCompoundCurve:5:CompoundCurve')
self.assertEqual(vl.dataProvider().subLayers()[0], '0:testMixOfLineStringCompoundCurve:5:CompoundCurve:')

def testGpxElevation(self):
# GPX without elevation data
@@ -84,7 +84,7 @@ def testCurveGeometryType(self):
ds = None

vl = QgsVectorLayer('{}'.format(tmpfile), 'test', 'ogr')
self.assertEqual(vl.dataProvider().subLayers(), ['0:test:0:CurvePolygon'])
self.assertEqual(vl.dataProvider().subLayers(), ['0:test:0:CurvePolygon:geom'])
f = QgsFeature()
f.setGeometry(QgsGeometry.fromWkt('POLYGON ((0 0,0 1,1 1,0 0))'))
vl.dataProvider().addFeatures([f])

0 comments on commit 8abf6dc

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