Skip to content
Permalink
Browse files

Add unit test

  • Loading branch information
pblottiere committed May 14, 2018
1 parent 2564cf3 commit ecbd2079fd214d772244deafead257877be75c05
Showing with 23 additions and 0 deletions.
  1. +23 −0 tests/src/python/test_qgsproject.py
@@ -23,6 +23,7 @@
QgsApplication,
QgsUnitTypes,
QgsCoordinateReferenceSystem,
QgsLabelingEngineSettings,
QgsVectorLayer,
QgsRasterLayer,
QgsMapLayer,
@@ -1033,6 +1034,28 @@ def testCustomLayerOrderFrom3xProject(self):
self.assertEqual(tree.customLayerOrder(), [layer_y, layer_x])
self.assertEqual(tree.layerOrder(), [layer_y, layer_x])

def testPalPropertiesReadWrite(self):
tmpDir = QTemporaryDir()
tmpFile = "{}/project.qgs".format(tmpDir.path())

s0 = QgsLabelingEngineSettings()
s0.setNumCandidatePositions(3, 33, 333)

p0 = QgsProject()
p0.setFileName(tmpFile)
p0.setLabelingEngineSettings(s0)
p0.write()

p1 = QgsProject()
p1.read(tmpFile)

s1 = p1.labelingEngineSettings()
candidates = s1.numCandidatePositions()

self.assertEqual(candidates[0], 3)
self.assertEqual(candidates[1], 33)
self.assertEqual(candidates[2], 333)


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

0 comments on commit ecbd207

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