Skip to content
Permalink
Browse files
Add unit test to ensure that #13263 is fixed
Fix #13263
  • Loading branch information
nyalldawson committed Apr 3, 2017
1 parent 603365c commit 17a3d1fd70b2df94c39cbd51ba1be6ef06925716
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/src/python/test_qgsrasterlayer.py
@@ -397,6 +397,18 @@ def testPalettedColorTableToClassData(self):
self.assertEqual(classes[1].color.name(), '#00ff00')
self.assertEqual(classes[2].color.name(), '#0000ff')

# test #13263
path = os.path.join(unitTestDataPath('raster'),
'hub13263.vrt')
info = QFileInfo(path)
base_name = info.baseName()
layer = QgsRasterLayer(path, base_name)
self.assertTrue(layer.isValid(), 'Raster not loaded: {}'.format(path))
classes = QgsPalettedRasterRenderer.colorTableToClassData(layer.dataProvider().colorTable(1))
self.assertEqual(len(classes), 4)
classes = QgsPalettedRasterRenderer.colorTableToClassData(layer.dataProvider().colorTable(15))
self.assertEqual(len(classes), 256)

def testLoadPalettedColorDataFromString(self):
"""
Test interpreting a bunch of color data format strings

0 comments on commit 17a3d1f

Please sign in to comment.