summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
authorselect-case <86375512+select-case@users.noreply.github.com>2022-09-24 21:46:08 +0530
committerGitHub <noreply@github.com>2022-09-24 17:16:08 +0100
commitf3822d4ab005ac5db9000ed384519edfd5bbc041 (patch)
tree96514e436ebd445959640c14cf37e779d16a643b /tests/gis_tests
parent2c7c22f94dc51b8b48a1590ba6d6d4b28fdcab82 (diff)
downloaddjango-f3822d4ab005ac5db9000ed384519edfd5bbc041.tar.gz
Fixed #34026 -- Fixed WKBReader.read() crash on string input.
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/geos_tests/test_io.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/gis_tests/geos_tests/test_io.py b/tests/gis_tests/geos_tests/test_io.py
index b9d24cc63e..cab4b0ed5b 100644
--- a/tests/gis_tests/geos_tests/test_io.py
+++ b/tests/gis_tests/geos_tests/test_io.py
@@ -56,15 +56,17 @@ class GEOSIOTest(SimpleTestCase):
# Creating a WKBReader instance
wkb_r = WKBReader()
- hex = b"000000000140140000000000004037000000000000"
- wkb = memoryview(binascii.a2b_hex(hex))
- ref = GEOSGeometry(hex)
+ hex_bin = b"000000000140140000000000004037000000000000"
+ hex_str = "000000000140140000000000004037000000000000"
+ wkb = memoryview(binascii.a2b_hex(hex_bin))
+ ref = GEOSGeometry(hex_bin)
# read() should return a GEOSGeometry on either a hex string or
# a WKB buffer.
g1 = wkb_r.read(wkb)
- g2 = wkb_r.read(hex)
- for geom in (g1, g2):
+ g2 = wkb_r.read(hex_bin)
+ g3 = wkb_r.read(hex_str)
+ for geom in (g1, g2, g3):
self.assertEqual(ref, geom)
bad_input = (1, 5.23, None, False)