Skip to content
Permalink
Browse files

Another test

  • Loading branch information
nyalldawson committed Nov 9, 2020
1 parent aa428a0 commit 78dcd2c32eeaeff76ef117eaff546de02351f1ea
Showing with 12 additions and 1 deletion.
  1. +12 −1 tests/src/python/test_qgspointcloudattributemodel.py
@@ -14,10 +14,13 @@

from qgis.core import (QgsPointCloudAttribute,
QgsPointCloudAttributeCollection,
QgsPointCloudAttributeModel)
QgsPointCloudAttributeModel,
QgsProviderRegistry,
QgsPointCloudLayer)
from qgis.PyQt.QtCore import QVariant, Qt, QModelIndex

from qgis.testing import start_app, unittest
from utilities import unitTestDataPath

start_app()

@@ -195,6 +198,14 @@ def testTooltip(self):
self.assertEqual(m.data(m.index(2, 0), Qt.ToolTipRole), "<b>y</b><br><font style='font-family:monospace; white-space: nowrap;'>Float</font>")
self.assertEqual(m.data(m.index(5, 0), Qt.ToolTipRole), "<b>red</b><br><font style='font-family:monospace; white-space: nowrap;'>Integer</font>")

@unittest.skipIf('ept' not in QgsProviderRegistry.instance().providerList(), 'EPT provider not available')
def testSetLayer(self):
m = QgsPointCloudAttributeModel()
layer = QgsPointCloudLayer(unitTestDataPath() + '/point_clouds/entwine/ept.json', 'test', 'ept')
self.assertTrue(layer.isValid())
m.setLayer(layer)
self.assertEqual([a.name() for a in m.attributes().attributes()], ['X', 'Y', 'Z', 'Intensity', 'ReturnNumber', 'NumberOfReturns', 'ScanDirectionFlag', 'EdgeOfFlightLine', 'Classification', 'ScanAngleRank', 'UserData', 'PointSourceId', 'GpsTime', 'Red', 'Green', 'Blue'])


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

0 comments on commit 78dcd2c

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