Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add unit test for postgres layer metadata
- Loading branch information
|
@@ -37,6 +37,7 @@ |
|
|
QgsReadWriteContext, |
|
|
QgsRectangle, |
|
|
QgsDefaultValue, |
|
|
QgsCoordinateReferenceSystem, |
|
|
QgsProject, |
|
|
QgsWkbTypes, |
|
|
QgsGeometry |
|
@@ -197,6 +198,13 @@ def test_table(dbconn, table_name, wkt): |
|
|
|
|
|
test_table(self.dbconn, 'pt4d', 'PointZM (1 2 3 4)') |
|
|
|
|
|
def testMetadata(self): |
|
|
""" Test that metadata is correctly acquired from provider """ |
|
|
metadata = self.vl.metadata() |
|
|
self.assertEqual(metadata.crs(), QgsCoordinateReferenceSystem.fromEpsgId(4326)) |
|
|
self.assertEqual(metadata.type(), 'dataset') |
|
|
self.assertEqual(metadata.abstract(), 'QGIS Test Table') |
|
|
|
|
|
def testGetFeaturesUniqueId(self): |
|
|
""" |
|
|
Test tables with inheritance for unique ids |
|
|
|
@@ -43,6 +43,8 @@ CREATE TABLE qgis_test."someData" ( |
|
|
geom public.geometry(Point,4326) |
|
|
); |
|
|
|
|
|
COMMENT ON TABLE qgis_test."someData" IS 'QGIS Test Table'; |
|
|
|
|
|
CREATE TABLE qgis_test."some_poly_data" ( |
|
|
pk SERIAL NOT NULL, |
|
|
geom public.geometry(Polygon,4326) |
|
|