Skip to content
Permalink
Browse files
Update test result for correct feature count state (uncounted)
  • Loading branch information
nyalldawson committed Jun 28, 2021
1 parent 686a814 commit 2de65c27818ebf75e077e74b117259f5452263ac
Showing with 5 additions and 2 deletions.
  1. +3 −1 src/gui/qgssublayersdialog.cpp
  2. +2 −1 tests/src/python/test_provider_shapefile.py
@@ -151,7 +151,9 @@ void QgsSublayersDialog::populateLayerTable( const QgsSublayersDialog::LayerDefi
QStringList elements;
elements << QString::number( item.layerId ) << item.layerName;
if ( mShowCount )
elements << ( item.count == -1 ? tr( "Unknown" ) : QString::number( item.count ) );
elements << ( item.count == static_cast< int >( Qgis::FeatureCountState::Uncounted ) ||
item.count == static_cast< int >( Qgis::FeatureCountState::UnknownCount )
? tr( "Unknown" ) : QString::number( item.count ) );
if ( mShowType )
elements << item.type;
if ( mShowDescription )
@@ -34,6 +34,7 @@
QgsVectorDataProvider,
QgsWkbTypes,
QgsVectorLayerExporter,
Qgis
)
from qgis.PyQt.QtCore import QVariant
from qgis.testing import start_app, unittest
@@ -1085,7 +1086,7 @@ def testSkipFeatureCountOnSubLayers(self):
self.assertTrue(provider.isValid())
sublayers = provider.subLayers()
self.assertTrue(len(sublayers) > 1)
self.assertEqual(sublayers[0].split(QgsDataProvider.sublayerSeparator())[2], '-1')
self.assertEqual(int(sublayers[0].split(QgsDataProvider.sublayerSeparator())[2]), int(Qgis.FeatureCountState.Uncounted))

def testLayersOnSameOGRLayerWithAndWithoutFilter(self):
"""Test fix for https://github.com/qgis/QGIS/issues/43361"""

0 comments on commit 2de65c2

Please sign in to comment.