summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2021-04-07 17:38:37 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-04-07 20:39:30 +0200
commit3ae4344bbd3b5e8bcb039bf701f53b68b317f57b (patch)
tree2007d600f588b5bd479db7612ec5fe70b36adefe /tests
parent98abc0c90e0eb7fe3a71cfa360962cf59605f1d3 (diff)
Dropped support for GEOS 3.5 and GDAL 2.0.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/gdal_tests/test_raster.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/tests/gis_tests/gdal_tests/test_raster.py b/tests/gis_tests/gdal_tests/test_raster.py
index 7f690759f6..6858abc4d8 100644
--- a/tests/gis_tests/gdal_tests/test_raster.py
+++ b/tests/gis_tests/gdal_tests/test_raster.py
@@ -4,7 +4,7 @@ import struct
import tempfile
from unittest import mock
-from django.contrib.gis.gdal import GDAL_VERSION, GDALRaster, SpatialReference
+from django.contrib.gis.gdal import GDALRaster, SpatialReference
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.raster.band import GDALBand
from django.contrib.gis.shortcuts import numpy
@@ -270,8 +270,6 @@ class GDALRasterTests(SimpleTestCase):
self.assertEqual(result, [23] * 4)
def test_set_nodata_none_on_raster_creation(self):
- if GDAL_VERSION < (2, 1):
- self.skipTest("GDAL >= 2.1 is required for this test.")
# Create raster without data and without nodata value.
rast = GDALRaster({
'datatype': 1,
@@ -322,11 +320,6 @@ class GDALRasterTests(SimpleTestCase):
self.assertNotIn('OWNER', source.metadata['DEFAULT'])
def test_raster_info_accessor(self):
- if GDAL_VERSION < (2, 1):
- msg = 'GDAL ≥ 2.1 is required for using the info property.'
- with self.assertRaisesMessage(ValueError, msg):
- self.rs.info
- return
infos = self.rs.info
# Data
info_lines = [line.strip() for line in infos.split('\n') if line.strip() != '']
@@ -389,8 +382,7 @@ class GDALRasterTests(SimpleTestCase):
compressed = GDALRaster(compressed.name)
self.assertEqual(compressed.metadata['IMAGE_STRUCTURE']['COMPRESSION'], 'PACKBITS',)
self.assertEqual(compressed.bands[0].metadata['IMAGE_STRUCTURE']['PIXELTYPE'], 'SIGNEDBYTE')
- if GDAL_VERSION >= (2, 1):
- self.assertIn('Block=40x23', compressed.info)
+ self.assertIn('Block=40x23', compressed.info)
def test_raster_warp(self):
# Create in memory raster
@@ -796,13 +788,8 @@ class GDALBandTests(SimpleTestCase):
'height': 1,
'bands': [{'data': [0], 'nodata_value': 1}],
})
- if GDAL_VERSION < (2, 1):
- msg = 'GDAL >= 2.1 required to delete nodata values.'
- with self.assertRaisesMessage(ValueError, msg):
- rsmem.bands[0].nodata_value = None
- else:
- rsmem.bands[0].nodata_value = None
- self.assertIsNone(rsmem.bands[0].nodata_value)
+ rsmem.bands[0].nodata_value = None
+ self.assertIsNone(rsmem.bands[0].nodata_value)
def test_band_data_replication(self):
band = GDALRaster({