Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Tests] Add QgsSymbolLayerUtils::encodeSldUom test
  • Loading branch information
rldhont committed Jan 16, 2020
1 parent 39ae955 commit dbb53be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/src/python/test_qgssymbollayerutils.py
Expand Up @@ -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
Expand Down

0 comments on commit dbb53be

Please sign in to comment.