Skip to content

Commit 0491c27

Browse files
committed
Added coordinate system python test and set cmake to copy qgis.db and srs.db into output dir so tests that rely on those can work
1 parent 13ab193 commit 0491c27

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
IF (ENABLE_TESTS)
2+
3+
# Install any resoure files needed here...
4+
INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/srs.db DESTINATION ${QGIS_OUTPUT_DIRECTORY}/share/qgis/resources/)
5+
INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/qgis.db DESTINATION ${QGIS_OUTPUT_DIRECTORY}/share/qgis/resources/)
6+
27
IF (APPLE)
38
# override default data path, otherwise looks for Resources in app bundle
49
SET (QGIS_DATA_SUBDIR "${CMAKE_SOURCE_DIR}/resources")

tests/src/python/test_qgscoordinatetransform.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ def testTransformBoundingBox(self):
2121
myUtmCrs.createFromId(32756, QgsCoordinateReferenceSystem.EpsgCrsId)
2222
myXForm = QgsCoordinateTransform(myUtmCrs, myGeoCrs)
2323
myProjectedExtent = myXForm.transformBoundingBox(myExtent)
24-
myExpectedExtent = ''
24+
myExpectedExtent = ('150.1509239873580270,-35.7176936443908772 : '
25+
'150.1964384662953194,-35.6971885216629090')
2526
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
2627
( myExpectedExtent,
2728
myProjectedExtent.toString()))
2829

29-
assert myExpectedExtent == myProjectedExtent, myMessage
30+
self.assertEquals(myExpectedExtent, myProjectedExtent.toString(), myMessage)
3031

3132
if __name__ == '__main__':
3233
unittest.main()

tests/src/python/utilities.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def getQgisTestApp():
6868
if QGISAPP is None:
6969
myGuiFlag = True # All test will run qgis in gui mode
7070
QGISAPP = QgsApplication(sys.argv, myGuiFlag)
71-
if 'QGISPATH' in os.environ:
72-
myPath = os.environ['QGISPATH']
71+
if 'QGIS_PREFIX_PATH' in os.environ:
72+
myPath = os.environ['QGIS_PREFIX_PATH']
7373
myUseDefaultPathFlag = True
7474
QGISAPP.setPrefixPath(myPath, myUseDefaultPathFlag)
7575

0 commit comments

Comments
 (0)