Skip to content

Commit

Permalink
Adapted test to new provider changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed May 25, 2016
1 parent e72cf56 commit 6b715c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsserver_wfst.py
Expand Up @@ -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')
Expand Down

3 comments on commit 6b715c5

@elpaso
Copy link
Contributor Author

@elpaso elpaso commented on 6b715c5 May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

@elpaso elpaso commented on 6b715c5 May 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.