Skip to content
Permalink
Browse files

DB connections API: mssql test for fields()

  • Loading branch information
elpaso committed Jul 6, 2020
1 parent dc67a4e commit 1d1b689590c4660946e1992296e3158b6203be00
Showing with 8 additions and 0 deletions.
  1. +8 −0 tests/src/python/test_qgsproviderconnection_mssql.py
@@ -101,6 +101,14 @@ def test_table_uri(self):
vl = QgsVectorLayer(conn.tableUri('qgis_test', 'someData'), 'my', 'mssql')
self.assertTrue(vl.isValid())

def test_gpkg_fields(self):
"""Test fields"""

md = QgsProviderRegistry.instance().providerMetadata('mssql')
conn = md.createConnection(self.uri, {})
fields = conn.fields('qgis_test', 'someData')
self.assertEqual(fields.names(), ['pk', 'cnt', 'name', 'name2', 'num_char'])


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

0 comments on commit 1d1b689

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