Skip to content

Commit

Permalink
[WFS provider] Change feature paging enabled option to be tri-state (…
Browse files Browse the repository at this point in the history
…default, enabled, disabled), to allow a user to effectively override server capabilities
  • Loading branch information
rouault committed Jan 21, 2024
1 parent adb51b3 commit 60df8f7
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 42 deletions.
3 changes: 3 additions & 0 deletions python/PyQt6/gui/auto_additions/qgsnewhttpconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
QgsNewHttpConnection.WFS_VERSION_1_1 = QgsNewHttpConnection.WfsVersionIndex.WFS_VERSION_1_1
QgsNewHttpConnection.WFS_VERSION_2_0 = QgsNewHttpConnection.WfsVersionIndex.WFS_VERSION_2_0
QgsNewHttpConnection.WFS_VERSION_API_FEATURES_1_0 = QgsNewHttpConnection.WfsVersionIndex.WFS_VERSION_API_FEATURES_1_0
QgsNewHttpConnection.WFS_FEATURE_PAGING_DEFAULT = QgsNewHttpConnection.WfsFeaturePagingIndex.WFS_FEATURE_PAGING_DEFAULT
QgsNewHttpConnection.WFS_FEATURE_PAGING_ENABLED = QgsNewHttpConnection.WfsFeaturePagingIndex.WFS_FEATURE_PAGING_ENABLED
QgsNewHttpConnection.WFS_FEATURE_PAGING_DISABLED = QgsNewHttpConnection.WfsFeaturePagingIndex.WFS_FEATURE_PAGING_DISABLED
7 changes: 7 additions & 0 deletions python/PyQt6/gui/auto_generated/qgsnewhttpconnection.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ Returns the current connection url.
WFS_VERSION_API_FEATURES_1_0,
};

enum WfsFeaturePagingIndex
{
WFS_FEATURE_PAGING_DEFAULT,
WFS_FEATURE_PAGING_ENABLED,
WFS_FEATURE_PAGING_DISABLED,
};

virtual bool validate();
%Docstring
Returns ``True`` if dialog settings are valid, or ``False`` if current
Expand Down
7 changes: 7 additions & 0 deletions python/gui/auto_generated/qgsnewhttpconnection.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ Returns the current connection url.
WFS_VERSION_API_FEATURES_1_0,
};

enum WfsFeaturePagingIndex
{
WFS_FEATURE_PAGING_DEFAULT,
WFS_FEATURE_PAGING_ENABLED,
WFS_FEATURE_PAGING_DISABLED,
};

virtual bool validate();
%Docstring
Returns ``True`` if dialog settings are valid, or ``False`` if current
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsowsconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const QgsSettingsEntryEnumFlag<Qgis::DpiMode> *QgsOwsConnection::settingsDpiMode
const QgsSettingsEntryEnumFlag<Qgis::TilePixelRatio> *QgsOwsConnection::settingsTilePixelRatio = new QgsSettingsEntryEnumFlag<Qgis::TilePixelRatio>( QStringLiteral( "tile-pixel-ratio" ), sTreeOwsConnections, Qgis::TilePixelRatio::Undefined, QString(), Qgis::SettingsOption::SaveEnumFlagAsInt ) ;
const QgsSettingsEntryString *QgsOwsConnection::settingsMaxNumFeatures = new QgsSettingsEntryString( QStringLiteral( "max-num-features" ), sTreeOwsConnections ) ;
const QgsSettingsEntryString *QgsOwsConnection::settingsPagesize = new QgsSettingsEntryString( QStringLiteral( "page-size" ), sTreeOwsConnections ) ;
const QgsSettingsEntryBool *QgsOwsConnection::settingsPagingEnabled = new QgsSettingsEntryBool( QStringLiteral( "paging-enabled" ), sTreeOwsConnections, true ) ;
const QgsSettingsEntryString *QgsOwsConnection::settingsPagingEnabled = new QgsSettingsEntryString( QStringLiteral( "paging-enabled" ), sTreeOwsConnections, QString( "default" ) ) ;
const QgsSettingsEntryBool *QgsOwsConnection::settingsPreferCoordinatesForWfsT11 = new QgsSettingsEntryBool( QStringLiteral( "prefer-coordinates-for-wfs-T11" ), sTreeOwsConnections, false ) ;
const QgsSettingsEntryBool *QgsOwsConnection::settingsIgnoreAxisOrientation = new QgsSettingsEntryBool( QStringLiteral( "ignore-axis-orientation" ), sTreeOwsConnections, false ) ;
const QgsSettingsEntryBool *QgsOwsConnection::settingsInvertAxisOrientation = new QgsSettingsEntryBool( QStringLiteral( "invert-axis-orientation" ), sTreeOwsConnections, false ) ;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsowsconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CORE_EXPORT QgsOwsConnection : public QObject
static const QgsSettingsEntryEnumFlag<Qgis::TilePixelRatio> *settingsTilePixelRatio;
static const QgsSettingsEntryString *settingsMaxNumFeatures;
static const QgsSettingsEntryString *settingsPagesize;
static const QgsSettingsEntryBool *settingsPagingEnabled;
static const QgsSettingsEntryString *settingsPagingEnabled;
static const QgsSettingsEntryBool *settingsPreferCoordinatesForWfsT11;
static const QgsSettingsEntryBool *settingsIgnoreAxisOrientation;
static const QgsSettingsEntryBool *settingsInvertAxisOrientation;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmanageconnectionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ void QgsManageConnectionsDialog::loadWfsConnections( const QDomDocument &doc, co
QgsOwsConnection::settingsVersion->setValue( child.attribute( QStringLiteral( "version" ) ), {QStringLiteral( "wfs" ), connectionName} );
QgsOwsConnection::settingsMaxNumFeatures->setValue( child.attribute( QStringLiteral( "maxnumfeatures" ) ), {QStringLiteral( "wfs" ), connectionName} );
QgsOwsConnection::settingsPagesize->setValue( child.attribute( QStringLiteral( "pagesize" ) ), {QStringLiteral( "wfs" ), connectionName} );
QgsOwsConnection::settingsPagingEnabled->setValue( child.attribute( QStringLiteral( "pagingenabled" ) ).toInt(), {QStringLiteral( "wfs" ), connectionName} );
QgsOwsConnection::settingsPagingEnabled->setValue( child.attribute( QStringLiteral( "pagingenabled" ) ), {QStringLiteral( "wfs" ), connectionName} );
QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( child.attribute( QStringLiteral( "ignoreAxisOrientation" ) ).toInt(), {QStringLiteral( "wfs" ), connectionName} );
QgsOwsConnection::settingsInvertAxisOrientation->setValue( child.attribute( QStringLiteral( "invertAxisOrientation" ) ).toInt(), {QStringLiteral( "wfs" ), connectionName} );

Expand Down
51 changes: 38 additions & 13 deletions src/gui/qgsnewhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
this, &QgsNewHttpConnection::wfsVersionCurrentIndexChanged );

connect( cbxWfsFeaturePaging, &QCheckBox::stateChanged,
this, &QgsNewHttpConnection::wfsFeaturePagingStateChanged );
cmbFeaturePaging->clear();
cmbFeaturePaging->addItem( tr( "Default (trust server capabilities)" ) );
cmbFeaturePaging->addItem( tr( "Enabled" ) );
cmbFeaturePaging->addItem( tr( "Disabled" ) );
connect( cmbFeaturePaging,
static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
this, &QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged );

if ( !connectionName.isEmpty() )
{
Expand Down Expand Up @@ -176,18 +181,18 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
{
// For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
cbxWfsFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
lblPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
txtPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
cmbFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
lblPageSize->setEnabled( cmbFeaturePaging->currentIndex() != WFS_FEATURE_PAGING_DISABLED && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
txtPageSize->setEnabled( cmbFeaturePaging->currentIndex() != WFS_FEATURE_PAGING_DISABLED && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
}

void QgsNewHttpConnection::wfsFeaturePagingStateChanged( int state )
void QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged( int index )
{
lblPageSize->setEnabled( state == Qt::Checked );
txtPageSize->setEnabled( state == Qt::Checked );
lblPageSize->setEnabled( index != WFS_FEATURE_PAGING_DISABLED );
txtPageSize->setEnabled( index != WFS_FEATURE_PAGING_DISABLED );
}

QString QgsNewHttpConnection::name() const
Expand Down Expand Up @@ -268,9 +273,9 @@ QComboBox *QgsNewHttpConnection::wfsVersionComboBox()
return cmbVersion;
}

QCheckBox *QgsNewHttpConnection::wfsPagingEnabledCheckBox()
QComboBox *QgsNewHttpConnection::wfsPagingComboBox()
{
return cbxWfsFeaturePaging;
return cmbFeaturePaging;
}

QCheckBox *QgsNewHttpConnection::wfsUseGml2EncodingForTransactions()
Expand Down Expand Up @@ -333,9 +338,15 @@ void QgsNewHttpConnection::updateServiceSpecificSettings()
txtMaxNumFeatures->setText( QgsOwsConnection::settingsMaxNumFeatures->value( detailsParameters ) );

// Only default to paging enabled if WFS 2.0.0 or higher
const bool pagingEnabled = QgsOwsConnection::settingsPagingEnabled->valueWithDefaultOverride( versionIdx == WFS_VERSION_MAX || versionIdx >= WFS_VERSION_2_0, detailsParameters );
const QString pagingEnabled = QgsOwsConnection::settingsPagingEnabled->value( detailsParameters );
if ( pagingEnabled == QLatin1String( "enabled" ) )
cmbFeaturePaging->setCurrentIndex( WFS_FEATURE_PAGING_ENABLED );
else if ( pagingEnabled == QLatin1String( "disabled" ) )
cmbFeaturePaging->setCurrentIndex( WFS_FEATURE_PAGING_DISABLED );
else
cmbFeaturePaging->setCurrentIndex( WFS_FEATURE_PAGING_DEFAULT );

txtPageSize->setText( QgsOwsConnection::settingsPagesize->value( detailsParameters ) );
cbxWfsFeaturePaging->setChecked( pagingEnabled );
}

QUrl QgsNewHttpConnection::urlTrimmed() const
Expand Down Expand Up @@ -438,7 +449,21 @@ void QgsNewHttpConnection::accept()
QgsOwsConnection::settingsVersion->setValue( version, detailsParameters );
QgsOwsConnection::settingsMaxNumFeatures->setValue( txtMaxNumFeatures->text(), detailsParameters );
QgsOwsConnection::settingsPagesize->setValue( txtPageSize->text(), detailsParameters );
QgsOwsConnection::settingsPagingEnabled->setValue( cbxWfsFeaturePaging->isChecked(), detailsParameters );

QString pagingEnabled = QStringLiteral( "default" );
switch ( cmbFeaturePaging->currentIndex() )
{
case WFS_FEATURE_PAGING_DEFAULT:
pagingEnabled = QStringLiteral( "default" );
break;
case WFS_FEATURE_PAGING_ENABLED:
pagingEnabled = QStringLiteral( "enabled" );
break;
case WFS_FEATURE_PAGING_DISABLED:
pagingEnabled = QStringLiteral( "disabled" );
break;
}
QgsOwsConnection::settingsPagingEnabled->setValue( pagingEnabled, detailsParameters );
}

QStringList credentialsParameters = {mServiceName.toLower(), newConnectionName};
Expand Down
16 changes: 12 additions & 4 deletions src/gui/qgsnewhttpconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
void urlChanged( const QString & );
void updateOkButtonState();
void wfsVersionCurrentIndexChanged( int index );
void wfsFeaturePagingStateChanged( int state );
void wfsFeaturePagingCurrentIndexChanged( int index );

protected:

Expand All @@ -113,6 +113,14 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
WFS_VERSION_API_FEATURES_1_0 = 4,
};

//! Index of wfsFeaturePaging
enum WfsFeaturePagingIndex
{
WFS_FEATURE_PAGING_DEFAULT = 0,
WFS_FEATURE_PAGING_ENABLED = 1,
WFS_FEATURE_PAGING_DISABLED = 2,
};

/**
* Returns TRUE if dialog settings are valid, or FALSE if current
* settings are not valid and the dialog should not be acceptable.
Expand Down Expand Up @@ -145,10 +153,10 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
QComboBox *wfsVersionComboBox() SIP_SKIP;

/**
* Returns the "WFS paging enabled" checkbox
* \since QGIS 3.2
* Returns the "WFS paging" combobox
* \since QGIS 3.36
*/
QCheckBox *wfsPagingEnabledCheckBox() SIP_SKIP;
QComboBox *wfsPagingComboBox() SIP_SKIP;

/**
* Returns the "Use GML2 encoding for transactions" checkbox
Expand Down
9 changes: 5 additions & 4 deletions src/providers/wfs/oapif/qgsoapifprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,21 @@ bool QgsOapifProvider::init()

mShared->mServerMaxFeatures = apiRequest.maxLimit();

if ( mShared->mURI.maxNumFeatures() > 0 && mShared->mServerMaxFeatures > 0 && !mShared->mURI.pagingEnabled() )
const bool pagingEnabled = mShared->mURI.pagingStatus() != QgsWFSDataSourceURI::PagingStatus::DISABLED;
if ( mShared->mURI.maxNumFeatures() > 0 && mShared->mServerMaxFeatures > 0 && !pagingEnabled )
{
mShared->mMaxFeatures = std::min( mShared->mURI.maxNumFeatures(), mShared->mServerMaxFeatures );
}
else if ( mShared->mURI.maxNumFeatures() > 0 )
{
mShared->mMaxFeatures = mShared->mURI.maxNumFeatures();
}
else if ( mShared->mServerMaxFeatures > 0 && !mShared->mURI.pagingEnabled() )
else if ( mShared->mServerMaxFeatures > 0 && !pagingEnabled )
{
mShared->mMaxFeatures = mShared->mServerMaxFeatures;
}

if ( mShared->mURI.pagingEnabled() && mShared->mURI.pageSize() > 0 )
if ( pagingEnabled && mShared->mURI.pageSize() > 0 )
{
if ( mShared->mServerMaxFeatures > 0 )
{
Expand All @@ -133,7 +134,7 @@ bool QgsOapifProvider::init()
mShared->mPageSize = mShared->mURI.pageSize();
}
}
else if ( mShared->mURI.pagingEnabled() )
else if ( pagingEnabled )
{
if ( apiRequest.defaultLimit() > 0 && apiRequest.maxLimit() > 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ QgsWfsConnection::QgsWfsConnection( const QString &connName )
if ( settingsPagingEnabled->exists( detailsParameters ) )
{
mUri.removeParam( QgsWFSConstants::URI_PARAM_PAGING_ENABLED ); // setParam allow for duplicates!
mUri.setParam( QgsWFSConstants::URI_PARAM_PAGING_ENABLED, settingsPagingEnabled->value( detailsParameters ) ? QStringLiteral( "true" ) : QStringLiteral( "false" ) );
mUri.setParam( QgsWFSConstants::URI_PARAM_PAGING_ENABLED, settingsPagingEnabled->value( detailsParameters ) );
}

if ( settingsPreferCoordinatesForWfsT11->exists( detailsParameters ) )
Expand Down
12 changes: 9 additions & 3 deletions src/providers/wfs/qgswfsdatasourceuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,17 @@ long long QgsWFSDataSourceURI::pageSize() const
return mURI.param( QgsWFSConstants::URI_PARAM_PAGE_SIZE ).toLongLong();
}

bool QgsWFSDataSourceURI::pagingEnabled() const
QgsWFSDataSourceURI::PagingStatus QgsWFSDataSourceURI::pagingStatus() const
{
if ( !mURI.hasParam( QgsWFSConstants::URI_PARAM_PAGING_ENABLED ) )
return true;
return mURI.param( QgsWFSConstants::URI_PARAM_PAGING_ENABLED ) == QLatin1String( "true" );
return PagingStatus::DEFAULT;
const QString val = mURI.param( QgsWFSConstants::URI_PARAM_PAGING_ENABLED );
if ( val == QLatin1String( "true" ) || val == QLatin1String( "enabled" ) )
return PagingStatus::ENABLED;
else if ( val == QLatin1String( "disabled" ) )
return PagingStatus::DISABLED;
else
return PagingStatus::DEFAULT;
}

void QgsWFSDataSourceURI::setTypeName( const QString &typeName )
Expand Down
10 changes: 9 additions & 1 deletion src/providers/wfs/qgswfsdatasourceuri.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,16 @@ class QgsWFSDataSourceURI
//! Returns user defined limit page size. 0=server udefault
long long pageSize() const;

//! Whether paging is enabled
enum class PagingStatus
{
DEFAULT, //! For WFS <= 1.1, no paging. For WFS 2.0, trust GetCapabilities "ImplementsResultPaging"
ENABLED, //! Enabled
DISABLED // Disabled
};

//! Returns whether paging is enabled.
bool pagingEnabled() const;
PagingStatus pagingStatus() const;

//! Gets typename (with prefix)
QString typeName() const;
Expand Down
5 changes: 3 additions & 2 deletions src/providers/wfs/qgswfsnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ void QgsWFSNewConnection::capabilitiesReplyFinished()
wfsPageSizeLineEdit()->setText( QString::number( caps.maxFeatures ) );
}
wfsVersionComboBox()->setCurrentIndex( versionIdx );
wfsPagingEnabledCheckBox()->setChecked( caps.supportsPaging );

wfsPagingComboBox()->setCurrentIndex( caps.supportsPaging ? WFS_FEATURE_PAGING_ENABLED : WFS_FEATURE_PAGING_DISABLED );

mCapabilities.reset();
}
Expand Down Expand Up @@ -159,7 +160,7 @@ void QgsWFSNewConnection::oapifLandingPageReplyFinished()
}

wfsVersionComboBox()->setCurrentIndex( WFS_VERSION_API_FEATURES_1_0 );
wfsPagingEnabledCheckBox()->setChecked( true );
wfsPagingComboBox()->setCurrentIndex( WFS_FEATURE_PAGING_ENABLED );

mCapabilities.reset();

Expand Down
18 changes: 15 additions & 3 deletions src/providers/wfs/qgswfsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2582,15 +2582,27 @@ bool QgsWFSProvider::getCapabilities()
mShared->mURI.setPostEndpoints( mShared->mCaps.operationPostEndpoints );

mShared->mWFSVersion = mShared->mCaps.version;
if ( mShared->mURI.maxNumFeatures() > 0 && mShared->mCaps.maxFeatures > 0 && !( mShared->mCaps.supportsPaging && mShared->mURI.pagingEnabled() ) )

bool pagingEnabled = false;
if ( mShared->mURI.pagingStatus() == QgsWFSDataSourceURI::PagingStatus::ENABLED )
{
pagingEnabled = true;
}
else if ( mShared->mWFSVersion.startsWith( QLatin1String( "2.0" ) ) )
{
if ( mShared->mCaps.supportsPaging && mShared->mURI.pagingStatus() == QgsWFSDataSourceURI::PagingStatus::DEFAULT )
pagingEnabled = true;
}

if ( mShared->mURI.maxNumFeatures() > 0 && mShared->mCaps.maxFeatures > 0 && !pagingEnabled )
{
mShared->mMaxFeatures = std::min( mShared->mURI.maxNumFeatures(), mShared->mCaps.maxFeatures );
}
else if ( mShared->mURI.maxNumFeatures() > 0 )
{
mShared->mMaxFeatures = mShared->mURI.maxNumFeatures();
}
else if ( mShared->mCaps.maxFeatures > 0 && !( mShared->mCaps.supportsPaging && mShared->mURI.pagingEnabled() ) )
else if ( mShared->mCaps.maxFeatures > 0 && !pagingEnabled )
{
mShared->mMaxFeatures = mShared->mCaps.maxFeatures;
}
Expand All @@ -2599,7 +2611,7 @@ bool QgsWFSProvider::getCapabilities()
mShared->mMaxFeatures = 0;
}

if ( mShared->mCaps.supportsPaging && mShared->mURI.pagingEnabled() )
if ( pagingEnabled )
{
if ( mShared->mURI.pageSize() > 0 )
{
Expand Down
12 changes: 6 additions & 6 deletions src/ui/qgsnewhttpconnectionbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="cbxWfsFeaturePaging">
<item row="3" column="0">
<widget class="QLabel" name="lblFeaturePaging">
<property name="text">
<string>Enable feature paging</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Feature paging</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="cmbFeaturePaging"/>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="txtMaxNumFeatures">
<property name="toolTip">
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/test_provider_wfs_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test(self):
self.addWfsLayer_layer_name = None
main_dialog.addVectorLayer.connect(self.slotAddWfsLayer)
QTest.mouseClick(buttonAdd, Qt.MouseButton.LeftButton)
self.assertEqual(self.addWfsLayer_uri, ' pagingEnabled=\'true\' preferCoordinatesForWfsT11=\'false\' restrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\'')
self.assertEqual(self.addWfsLayer_uri, ' pagingEnabled=\'default\' preferCoordinatesForWfsT11=\'false\' restrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\'')
self.assertEqual(self.addWfsLayer_layer_name, 'my:typename')

# Click on Build Query
Expand Down Expand Up @@ -301,7 +301,7 @@ def test(self):
self.addWfsLayer_layer_name = None
main_dialog.addVectorLayer.connect(self.slotAddWfsLayer)
QTest.mouseClick(buttonAdd, Qt.MouseButton.LeftButton)
self.assertEqual(self.addWfsLayer_uri, ' pagingEnabled=\'true\' preferCoordinatesForWfsT11=\'false\' restrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\' sql=SELECT * FROM typename WHERE 1 = 1')
self.assertEqual(self.addWfsLayer_uri, ' pagingEnabled=\'default\' preferCoordinatesForWfsT11=\'false\' restrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\' sql=SELECT * FROM typename WHERE 1 = 1')
self.assertEqual(self.addWfsLayer_layer_name, 'my:typename')

# main_dialog.setProperty("hideDialogs", None)
Expand Down

0 comments on commit 60df8f7

Please sign in to comment.