Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Make TestQgsCoordinateOperationWidget tolerant to presence of grid sh…
- Loading branch information
Showing
with
11 additions
and
5 deletions.
-
+11
−5
tests/src/python/test_qgscoordinateoperationwidget.py
|
@@ -58,9 +58,16 @@ def testOperations(self): |
|
|
self.assertTrue(w.hasSelection()) |
|
|
self.assertGreaterEqual(len(w.availableOperations()), 3) |
|
|
|
|
|
self.assertEqual(w.defaultOperation().proj, '+proj=pipeline +step +proj=unitconvert +xy_in=us-ft +xy_out=m +step +inv +proj=lcc +lat_0=33.5 +lon_0=-118 +lat_1=35.4666666666667 +lat_2=34.0333333333333 +x_0=609601.219202438 +y_0=0 +ellps=clrk66 +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-8 +y=159 +z=175 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84') |
|
|
self.assertEqual(w.selectedOperation().proj, |
|
|
'+proj=pipeline +step +proj=unitconvert +xy_in=us-ft +xy_out=m +step +inv +proj=lcc +lat_0=33.5 +lon_0=-118 +lat_1=35.4666666666667 +lat_2=34.0333333333333 +x_0=609601.219202438 +y_0=0 +ellps=clrk66 +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-8 +y=159 +z=175 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84') |
|
|
available_operations = QgsDatumTransform.operations(w.sourceCrs(), w.destinationCrs()) |
|
|
for op in available_operations: |
|
|
if op.isAvailable: |
|
|
default_proj = op.proj |
|
|
break |
|
|
else: |
|
|
self.assertTrue(False, 'No operations available') |
|
|
|
|
|
self.assertEqual(w.defaultOperation().proj, default_proj) |
|
|
self.assertEqual(w.selectedOperation().proj, default_proj) |
|
|
self.assertTrue(w.selectedOperation().isAvailable) |
|
|
|
|
|
op = QgsCoordinateOperationWidget.OperationDetails() |
|
@@ -97,8 +104,7 @@ def testOperations(self): |
|
|
w.setSelectedOperation(op) |
|
|
w.setSelectedOperationUsingContext(context) |
|
|
# should go to default, because there's nothing in the context matching these crs |
|
|
self.assertEqual(w.selectedOperation().proj, |
|
|
'+proj=pipeline +step +proj=unitconvert +xy_in=us-ft +xy_out=m +step +inv +proj=lcc +lat_0=33.5 +lon_0=-118 +lat_1=35.4666666666667 +lat_2=34.0333333333333 +x_0=609601.219202438 +y_0=0 +ellps=clrk66 +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-8 +y=159 +z=175 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84') |
|
|
self.assertEqual(w.selectedOperation().proj, default_proj) |
|
|
self.assertEqual(len(spy), 6) |
|
|
|
|
|
# put something in the context |
|
|