summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-20 08:01:02 -0500
committerGitHub <noreply@github.com>2017-01-20 08:01:02 -0500
commit4e729feaa647547f25debb1cb63dec989dc41a20 (patch)
tree7c7a38c5961bf4daf98a8cb47dc74c769563ffcf /tests/gis_tests
parentec4c1d6717da7a9d09d5b3ce84cccac819bb592c (diff)
Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/gdal_tests/test_raster.py8
-rw-r--r--tests/gis_tests/geo3d/tests.py3
-rw-r--r--tests/gis_tests/geogapp/tests.py3
-rw-r--r--tests/gis_tests/layermap/tests.py3
-rw-r--r--tests/gis_tests/test_data.py3
5 files changed, 7 insertions, 13 deletions
diff --git a/tests/gis_tests/gdal_tests/test_raster.py b/tests/gis_tests/gdal_tests/test_raster.py
index 1a2753c717..cd850af9a1 100644
--- a/tests/gis_tests/gdal_tests/test_raster.py
+++ b/tests/gis_tests/gdal_tests/test_raster.py
@@ -49,7 +49,6 @@ from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.shortcuts import numpy
from django.test import SimpleTestCase
-from django.utils._os import upath
from ..data.rasters.textrasters import JSON_RASTER
@@ -64,8 +63,7 @@ class GDALRasterTests(SimpleTestCase):
Test a GDALRaster instance created from a file (GeoTiff).
"""
def setUp(self):
- self.rs_path = os.path.join(os.path.dirname(upath(__file__)),
- '../data/rasters/raster.tif')
+ self.rs_path = os.path.join(os.path.dirname(__file__), '../data/rasters/raster.tif')
self.rs = GDALRaster(self.rs_path)
def test_rs_name_repr(self):
@@ -388,7 +386,7 @@ class GDALRasterTests(SimpleTestCase):
@unittest.skipUnless(HAS_GDAL, "GDAL is required")
class GDALBandTests(SimpleTestCase):
def setUp(self):
- self.rs_path = os.path.join(os.path.dirname(upath(__file__)), '../data/rasters/raster.tif')
+ self.rs_path = os.path.join(os.path.dirname(__file__), '../data/rasters/raster.tif')
rs = GDALRaster(self.rs_path)
self.band = rs.bands[0]
@@ -403,7 +401,7 @@ class GDALBandTests(SimpleTestCase):
if numpy:
data = self.band.data()
assert_array = numpy.loadtxt(
- os.path.join(os.path.dirname(upath(__file__)), '../data/rasters/raster.numpy.txt')
+ os.path.join(os.path.dirname(__file__), '../data/rasters/raster.numpy.txt')
)
numpy.testing.assert_equal(data, assert_array)
self.assertEqual(data.shape, (self.band.height, self.band.width))
diff --git a/tests/gis_tests/geo3d/tests.py b/tests/gis_tests/geo3d/tests.py
index 72be664014..f05e2e35ce 100644
--- a/tests/gis_tests/geo3d/tests.py
+++ b/tests/gis_tests/geo3d/tests.py
@@ -7,14 +7,13 @@ from django.contrib.gis.db.models.functions import (
)
from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon
from django.test import TestCase, skipUnlessDBFeature
-from django.utils._os import upath
from .models import (
City3D, Interstate2D, Interstate3D, InterstateProj2D, InterstateProj3D,
MultiPoint3D, Point2D, Point3D, Polygon2D, Polygon3D,
)
-data_path = os.path.realpath(os.path.join(os.path.dirname(upath(__file__)), '..', 'data'))
+data_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
city_file = os.path.join(data_path, 'cities', 'cities.shp')
vrt_file = os.path.join(data_path, 'test_vrt', 'test_vrt.vrt')
diff --git a/tests/gis_tests/geogapp/tests.py b/tests/gis_tests/geogapp/tests.py
index 7112f0238e..551fda4b83 100644
--- a/tests/gis_tests/geogapp/tests.py
+++ b/tests/gis_tests/geogapp/tests.py
@@ -10,7 +10,6 @@ from django.contrib.gis.measure import D
from django.db import connection
from django.db.models.functions import Cast
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
-from django.utils._os import upath
from ..utils import oracle, postgis, spatialite
from .models import City, County, Zipcode
@@ -66,7 +65,7 @@ class GeographyTest(TestCase):
from django.contrib.gis.utils import LayerMapping
# Getting the shapefile and mapping dictionary.
- shp_path = os.path.realpath(os.path.join(os.path.dirname(upath(__file__)), '..', 'data'))
+ shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
co_shp = os.path.join(shp_path, 'counties', 'counties.shp')
co_mapping = {'name': 'Name',
'state': 'State',
diff --git a/tests/gis_tests/layermap/tests.py b/tests/gis_tests/layermap/tests.py
index ce4b0c90d5..82bc534fbf 100644
--- a/tests/gis_tests/layermap/tests.py
+++ b/tests/gis_tests/layermap/tests.py
@@ -8,7 +8,6 @@ from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.db import connection
from django.test import TestCase, override_settings, skipUnlessDBFeature
-from django.utils._os import upath
if HAS_GEOS and HAS_GDAL:
from django.contrib.gis.utils.layermapping import (
@@ -23,7 +22,7 @@ if HAS_GEOS and HAS_GDAL:
)
-shp_path = os.path.realpath(os.path.join(os.path.dirname(upath(__file__)), os.pardir, 'data'))
+shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, 'data'))
city_shp = os.path.join(shp_path, 'cities', 'cities.shp')
co_shp = os.path.join(shp_path, 'counties', 'counties.shp')
inter_shp = os.path.join(shp_path, 'interstates', 'interstates.shp')
diff --git a/tests/gis_tests/test_data.py b/tests/gis_tests/test_data.py
index 23df42c007..4bec3c677e 100644
--- a/tests/gis_tests/test_data.py
+++ b/tests/gis_tests/test_data.py
@@ -5,11 +5,10 @@ for the GEOS and GDAL tests.
import json
import os
-from django.utils._os import upath
from django.utils.functional import cached_property
# Path where reference test data is located.
-TEST_DATA = os.path.join(os.path.dirname(upath(__file__)), 'data')
+TEST_DATA = os.path.join(os.path.dirname(__file__), 'data')
def tuplize(seq):