summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-04-16 10:50:24 +0200
committerClaude Paroz <claude@2xlibre.net>2016-04-16 19:51:00 +0200
commit10c53385f85aa424e83c65a002d5ca1679d2dd71 (patch)
treef98ecff9bdcd6d50daa5d4711a19419e8a976e99 /tests
parent05d08367d781a11ce935bec1eb18f2b59ad5ed1b (diff)
Fixed #26510 -- Allowed dim/trim/precision as WKTWriter init arguments
Thanks Tim Graham for the review.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geos_tests/test_io.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/gis_tests/geos_tests/test_io.py b/tests/gis_tests/geos_tests/test_io.py
index e761cd61a3..10762c0821 100644
--- a/tests/gis_tests/geos_tests/test_io.py
+++ b/tests/gis_tests/geos_tests/test_io.py
@@ -42,6 +42,12 @@ class GEOSIOTest(SimpleTestCase):
ref_wkt = 'POINT (5.0000000000000000 23.0000000000000000)'
self.assertEqual(ref_wkt, wkt_w.write(ref).decode())
+ def test_wktwriter_constructor_arguments(self):
+ wkt_w = WKTWriter(dim=3, trim=True, precision=3)
+ ref = GEOSGeometry('POINT (5.34562 23 1.5)')
+ ref_wkt = 'POINT Z (5.35 23 1.5)'
+ self.assertEqual(ref_wkt, wkt_w.write(ref).decode())
+
def test03_wkbreader(self):
# Creating a WKBReader instance
wkb_r = WKBReader()
@@ -101,7 +107,7 @@ class GEOSIOTest(SimpleTestCase):
# Ensuring bad output dimensions are not accepted
for bad_outdim in (-1, 0, 1, 4, 423, 'foo', None):
- with self.assertRaises(ValueError):
+ with self.assertRaisesMessage(ValueError, 'WKB output dimension must be 2 or 3'):
wkb_w.outdim = bad_outdim
# Now setting the output dimensions to be 3