Skip to content
Permalink
Browse files

[Tests] Add QgsSymbolLayerUtils::encodeSldUom test

  • Loading branch information
rldhont committed Jan 15, 2020
1 parent 39ae955 commit dbb53be7f3eda6e1c6aeb5124989aec77dc6d5da
Showing with 15 additions and 0 deletions.
  1. +15 −0 tests/src/python/test_qgssymbollayerutils.py
@@ -211,6 +211,21 @@ def testSymbolToFromMimeData(self):
self.assertTrue(symbol2 is not None)
self.assertEqual(symbol2.color().name(), symbol.color().name())

def testEncodeSldUom(self):
"""
Test Encodes a SLD unit of measure string to a render unit
"""

# millimeter
encode = None
encode = QgsSymbolLayerUtils.encodeSldUom(QgsUnitTypes.RenderMillimeters)
self.assertTupleEqual(encode, ('', 3.571428571428571))

# mapunits
encode = None
encode = QgsSymbolLayerUtils.encodeSldUom(QgsUnitTypes.RenderMapUnits)
self.assertTupleEqual(encode, ('http://www.opengeospatial.org/se/units/metre', 0.001))

def testDecodeSldUom(self):
"""
Test Decodes a SLD unit of measure string to a render unit

0 comments on commit dbb53be

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