diff options
author | Claude Paroz <claude@2xlibre.net> | 2022-07-25 18:33:25 +0200 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-07-25 20:48:33 +0200 |
commit | 2d23a07817b67825735a6900ebed505a004f7788 (patch) | |
tree | 4bf899bb5a4fc993cb536d6a9febb270a2449b4a /tests/gis_tests | |
parent | 36cd4259438f98e74e472e232307a1909f164e56 (diff) | |
download | django-2d23a07817b67825735a6900ebed505a004f7788.tar.gz |
Fixed #33866 -- Added pathlib.Path support to GDALRaster constructor.
Diffstat (limited to 'tests/gis_tests')
-rw-r--r-- | tests/gis_tests/gdal_tests/test_raster.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/gis_tests/gdal_tests/test_raster.py b/tests/gis_tests/gdal_tests/test_raster.py index 21f8fd27ac..cbe7d6b369 100644 --- a/tests/gis_tests/gdal_tests/test_raster.py +++ b/tests/gis_tests/gdal_tests/test_raster.py @@ -3,6 +3,7 @@ import shutil import struct import tempfile import zipfile +from pathlib import Path from unittest import mock from django.contrib.gis.gdal import GDALRaster, SpatialReference @@ -25,6 +26,11 @@ class GDALRasterTests(SimpleTestCase): ) self.rs = GDALRaster(self.rs_path) + def test_gdalraster_input_as_path(self): + rs_path = Path(__file__).parent.parent / "data" / "rasters" / "raster.tif" + rs = GDALRaster(rs_path) + self.assertEqual(str(rs_path), rs.name) + def test_rs_name_repr(self): self.assertEqual(self.rs_path, self.rs.name) self.assertRegex(repr(self.rs), r"<Raster object at 0x\w+>") |