summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-11-27 18:58:28 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-28 07:36:19 +0100
commitb37be072a27f3d4aaf22342a17afd0c24518ff8b (patch)
tree2fa4752ae15a74d4394086069ceee4608dd21afe /tests
parent3828879eee09da95bf99886c1ae182a36b1d89b3 (diff)
Fixed #32230 -- Made DataSource support pathlib.Path.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/gdal_tests/test_ds.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/gis_tests/gdal_tests/test_ds.py b/tests/gis_tests/gdal_tests/test_ds.py
index d462bec971..f2a6ddf101 100644
--- a/tests/gis_tests/gdal_tests/test_ds.py
+++ b/tests/gis_tests/gdal_tests/test_ds.py
@@ -1,6 +1,7 @@
import os
import re
from datetime import datetime
+from pathlib import Path
from django.contrib.gis.gdal import (
DataSource, Envelope, GDALException, OGRGeometry,
@@ -120,6 +121,11 @@ class DataSourceTest(SimpleTestCase):
with self.assertRaisesMessage(IndexError, 'Invalid OGR layer name given: invalid.'):
ds.__getitem__('invalid')
+ def test_ds_input_pathlib(self):
+ test_shp = Path(get_ds_file('test_point', 'shp'))
+ ds = DataSource(test_shp)
+ self.assertEqual(len(ds), 1)
+
def test02_invalid_shp(self):
"Testing invalid SHP files for the Data Source."
for source in bad_ds: