Skip to content
Permalink
Browse files

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
  • Loading branch information
timlinux committed Aug 26, 2012
1 parent 13ab193 commit 0491c27d09a77fd2d96ee73c0b07a8d2a8bcb1e9
Showing with 10 additions and 4 deletions.
  1. +5 −0 tests/CMakeLists.txt
  2. +3 −2 tests/src/python/test_qgscoordinatetransform.py
  3. +2 −2 tests/src/python/utilities.py
@@ -1,4 +1,9 @@
IF (ENABLE_TESTS)

# Install any resoure files needed here...
INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/srs.db DESTINATION ${QGIS_OUTPUT_DIRECTORY}/share/qgis/resources/)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/qgis.db DESTINATION ${QGIS_OUTPUT_DIRECTORY}/share/qgis/resources/)

IF (APPLE)
# override default data path, otherwise looks for Resources in app bundle
SET (QGIS_DATA_SUBDIR "${CMAKE_SOURCE_DIR}/resources")
@@ -21,12 +21,13 @@ def testTransformBoundingBox(self):
myUtmCrs.createFromId(32756, QgsCoordinateReferenceSystem.EpsgCrsId)
myXForm = QgsCoordinateTransform(myUtmCrs, myGeoCrs)
myProjectedExtent = myXForm.transformBoundingBox(myExtent)
myExpectedExtent = ''
myExpectedExtent = ('150.1509239873580270,-35.7176936443908772 : '
'150.1964384662953194,-35.6971885216629090')
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
( myExpectedExtent,
myProjectedExtent.toString()))

assert myExpectedExtent == myProjectedExtent, myMessage
self.assertEquals(myExpectedExtent, myProjectedExtent.toString(), myMessage)

if __name__ == '__main__':
unittest.main()
@@ -68,8 +68,8 @@ def getQgisTestApp():
if QGISAPP is None:
myGuiFlag = True # All test will run qgis in gui mode
QGISAPP = QgsApplication(sys.argv, myGuiFlag)
if 'QGISPATH' in os.environ:
myPath = os.environ['QGISPATH']
if 'QGIS_PREFIX_PATH' in os.environ:
myPath = os.environ['QGIS_PREFIX_PATH']
myUseDefaultPathFlag = True
QGISAPP.setPrefixPath(myPath, myUseDefaultPathFlag)

0 comments on commit 0491c27

Please sign in to comment.
You can’t perform that action at this time.