Skip to content
Permalink
Browse files

Adapted test to new provider changes

  • Loading branch information
elpaso committed May 25, 2016
1 parent e72cf56 commit 6b715c5bd61f5c521a34aee68a721a1648b66918
Showing with 1 addition and 1 deletion.
  1. +1 −1 tests/src/python/test_qgsserver_wfst.py
@@ -150,7 +150,7 @@ def _getWFSLayer(cls, type_name, layer_name=None):
cls.project_path),
'version': 'auto',
'table': '',
'sql': '',
#'sql': '',
}
uri = ' '.join([("%s='%s'" % (k, v)) for k, v in parms.iteritems()])
wfs_layer = QgsVectorLayer(uri, layer_name, 'WFS')

3 comments on commit 6b715c5

@elpaso

This comment has been minimized.

Copy link
Contributor Author

@elpaso elpaso replied May 25, 2016

@rouault can you please have a look? I had to change this test after your recent modifications to the wfst provider: an empty sql in the uri get parsed incorrectly as ' table='''

@rouault

This comment has been minimized.

Copy link
Contributor

@rouault rouault replied May 25, 2016

This is a generic behaviour of QgsDataSourceURI I didn't touch. Any character after sql= is considered as a string (no quoting). So sql='' is parsed as quote quote.

qgsdatasourceuri.cpp :

    if ( pname == "sql" )
    {
      // rest of line is a sql where clause
      skipBlanks( uri, i );
      mSql = uri.mid( i );
      break;
    }
@elpaso

This comment has been minimized.

Copy link
Contributor Author

@elpaso elpaso replied May 27, 2016

ok, got it. I'll change the test either using an ordered dict to store the parameters or using a string to make sure that sql stay at the end of the string.

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