Skip to content

Commit

Permalink
Add a Python test for checking the OFFSET is output correctly (#5715)
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika authored Feb 27, 2020
1 parent 3fe2874 commit b79ced1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions mapscript/python/tests/cases/style_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,34 @@ def testInsertNULLStyle(self):
self.assertRaises(mapscript.MapServerChildError,
class0.insertStyle, None)

def testConvertToString(self):
"""ensure styles can be created and output to strings
in a round trip"""
input_string = """
STYLE
SIZE 7.25
COLOR 255 0 0
OFFSET 10.5 20.75
END
"""

new_style = mapscript.fromstring(input_string)
assert new_style.size == 7.25
assert new_style.color.red == 255
assert new_style.color.green == 0
assert new_style.color.blue == 0

assert new_style.offsetx == 10.5
assert new_style.offsety == 20.75

output_string = new_style.convertToString()
new_style2 = mapscript.fromstring(output_string)

# ensure attributes are output as doubles
assert new_style.size == 7.25
assert new_style2.offsetx == 10.5
assert new_style2.offsety == 20.75

def testPattern(self):
"""See https://github.com/mapserver/mapserver/issues/4943"""

Expand Down

0 comments on commit b79ced1

Please sign in to comment.