mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Added a test for the direct determination of geometry type/srid
This commit is contained in:
parent
d9bbce65da
commit
cfa308d5ac
@ -59,6 +59,14 @@ class TestPyQgsPostgresProvider(TestCase, ProviderTestCase):
|
||||
assert self.provider.defaultValue(1) == NULL
|
||||
assert self.provider.defaultValue(2) == '\'qgis\'::text'
|
||||
|
||||
def testQueryLayers(self):
|
||||
def test_query(dbconn, query, key):
|
||||
ql = QgsVectorLayer('%s srid=4326 table="%s" (geom) key=\'%s\' sql=' % (dbconn, query.replace('"', '\\"'), key), "testgeom", "postgres")
|
||||
print query, key
|
||||
assert(ql.isValid())
|
||||
|
||||
test_query(self.dbconn, '(SELECT NULL::integer "Id1", NULL::integer "Id2", NULL::geometry(Point, 4326) geom LIMIT 0)', '"Id1","Id2"')
|
||||
|
||||
def testWkbTypes(self):
|
||||
def test_table(dbconn, table_name, wkt):
|
||||
vl = QgsVectorLayer('%s srid=4326 table="qgis_test".%s (geom) sql=' % (dbconn, table_name), "testgeom", "postgres")
|
||||
|
Loading…
x
Reference in New Issue
Block a user