2020-02-24 12:13:59 +00:00
|
|
|
import unittest
|
|
|
|
|
2022-02-03 19:24:19 +00:00
|
|
|
from django.contrib.gis.gdal import GDAL_VERSION, gdal_full_version, gdal_version
|
2020-02-24 12:13:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
class GDALTest(unittest.TestCase):
|
|
|
|
def test_gdal_version(self):
|
|
|
|
if GDAL_VERSION:
|
2022-02-03 19:24:19 +00:00
|
|
|
self.assertEqual(gdal_version(), ("%s.%s.%s" % GDAL_VERSION).encode())
|
2020-02-24 12:13:59 +00:00
|
|
|
else:
|
2022-02-03 19:24:19 +00:00
|
|
|
self.assertIn(b".", gdal_version())
|
2020-02-23 21:04:18 +00:00
|
|
|
|
|
|
|
def test_gdal_full_version(self):
|
|
|
|
full_version = gdal_full_version()
|
|
|
|
self.assertIn(gdal_version(), full_version)
|
2022-02-03 19:24:19 +00:00
|
|
|
self.assertTrue(full_version.startswith(b"GDAL"))
|