Skip to content
Permalink
Browse files

Remove test case on not existent view

  • Loading branch information
elpaso committed Feb 2, 2020
1 parent 6f82f3c commit 430d8c25cf74c6cf6d4ebf0e6d6fcdabff699759
Showing with 25 additions and 0 deletions.
  1. +25 −0 tests/src/python/test_qgsproviderconnection_postgres.py
@@ -164,6 +164,31 @@ def test_postgis_raster_rename(self):
self.assertFalse('Raster2' in table_names)
self.assertTrue('Raster1' in table_names)

def test_true_false(self):
"""Test returned values from BOOL queries"""

md = QgsProviderRegistry.instance().providerMetadata(self.providerKey)
conn = md.createConnection(self.uri, {})
self.assertEqual(conn.executeSql('SELECT FALSE'), [[False]])
self.assertEqual(conn.executeSql('SELECT TRUE'), [[True]])

def test_nulls(self):
"""Test returned values from typed NULL queries"""

md = QgsProviderRegistry.instance().providerMetadata(self.providerKey)
conn = md.createConnection(self.uri, {})
self.assertEqual(conn.executeSql('SELECT NULL::bool'), [[None]])
self.assertEqual(conn.executeSql('SELECT NULL::text'), [[None]])
self.assertEqual(conn.executeSql('SELECT NULL::bytea'), [[None]])

def test_pk_cols_order(self):
"""Test that PKs are returned in consistent order: see GH #34167"""

md = QgsProviderRegistry.instance().providerMetadata(self.providerKey)
conn = md.createConnection(self.uri, {})
self.assertEqual(conn.table('qgis_test', 'bikes_view').primaryKeyColumns(), ['pk', 'name'])
self.assertEqual(conn.table('qgis_test', 'some_poly_data_view').primaryKeyColumns(), ['pk', 'geom'])


if __name__ == '__main__':
unittest.main()

0 comments on commit 430d8c2

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