-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel
committed
Feb 9, 2024
1 parent
fa62405
commit 0f126fe
Showing
1 changed file
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,15 @@ | |
(at your option) any later version. | ||
""" | ||
__author__ = '[email protected]' | ||
__date__ = '20/01/2011' | ||
__copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' | ||
'Disaster Reduction') | ||
__author__ = "[email protected]" | ||
__date__ = "20/01/2011" | ||
__copyright__ = "Copyright 2012, Australia Indonesia Facility for " "Disaster Reduction" | ||
|
||
import unittest | ||
from qgis.core import ( | ||
QgsProviderRegistry) | ||
from qgis.core import QgsProviderRegistry, QgsCoordinateReferenceSystem | ||
|
||
from .utilities import get_qgis_app | ||
|
||
QGIS_APP = get_qgis_app() | ||
|
||
|
||
|
@@ -28,8 +27,24 @@ def test_qgis_environment(self): | |
"""QGIS environment has the expected providers""" | ||
|
||
r = QgsProviderRegistry.instance() | ||
self.assertIn('gdal', r.providerList()) | ||
self.assertIn('ogr', r.providerList()) | ||
|
||
if __name__ == '__main__': | ||
self.assertIn("gdal", r.providerList()) | ||
self.assertIn("ogr", r.providerList()) | ||
self.assertIn("postgres", r.providerList()) | ||
|
||
def test_projection(self): | ||
"""Test that QGIS properly parses a wkt string.""" | ||
crs = QgsCoordinateReferenceSystem() | ||
wkt = ( | ||
'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",' | ||
'SPHEROID["WGS_1984",6378137.0,298.257223563]],' | ||
'PRIMEM["Greenwich",0.0],UNIT["Degree",' | ||
"0.0174532925199433]]" | ||
) | ||
crs.createFromWkt(wkt) | ||
auth_id = crs.authid() | ||
expected_auth_id = "EPSG:4326" | ||
self.assertEqual(auth_id, expected_auth_id) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |