Skip to content
Permalink
Browse files

Upload images from python composer check to cdash, fix frame of pytho…

…n composer test
  • Loading branch information
Marco Hugentobler
Marco Hugentobler committed Aug 29, 2012
1 parent ad437bf commit a4c709e11e3ea4abae51cb98dd5fdc3d32831186
Showing with 6 additions and 11 deletions.
  1. +2 −8 tests/src/python/qgscompositionchecker.py
  2. +4 −3 tests/src/python/test_qgscomposermap.py
@@ -47,14 +47,8 @@ def testComposition(self, mTestName, mComposition, mExpectedImageFile, page=0
diffFilePath = QDir.tempPath() + QDir.separator() + QFileInfo( mExpectedImageFile ).baseName() + "_diff_python.png"
testResult = self.compareImages( expectedImage, outputImage, diffFilePath )

# myDashMessage = "<DartMeasurementFile name=\"Rendered Image " + mTestName + "\"
# " type=\"image/png\">" + renderedFilePath +
# "</DartMeasurementFile>"
# "<DartMeasurementFile name=\"Expected Image " + mTestName + "\" type=\"image/png\">" +
# mExpectedImageFile + "</DartMeasurementFile>"
# "<DartMeasurementFile name=\"Difference Image " + mTestName + "\" type=\"image/png\">" +
# diffFilePath + "</DartMeasurementFile>"

myDashMessage = "<DartMeasurementFile name=\"Rendered Image " + mTestName + "\"" + " type=\"image/png\">" + renderedFilePath + "</DartMeasurementFile>" + "\n" + "<DartMeasurementFile name=\"Expected Image " + mTestName + "\"" + " type=\"image/png\">" + mExpectedImageFile + "</DartMeasurementFile>" + "\n" + "<DartMeasurementFile name=\"Difference Image " + mTestName + "\"" + " type=\"image/png\">" + diffFilePath + "</DartMeasurementFile>"
qDebug( myDashMessage )
return testResult

def compareImages( self, imgExpected, imgRendered, differenceImagePath ):
@@ -43,6 +43,7 @@ def testCase(self):
mComposition = QgsComposition( mMapRenderer )
mComposition.setPaperSize( 297, 210 )
mComposerMap = QgsComposerMap( mComposition, 20, 20, 200, 100 )
mComposerMap.setFrameEnabled( True )
mComposition.addComposerMap( mComposerMap )
self.grid(mComposerMap, mComposition, TEST_DATA_DIR)
self.overviewMap(mComposerMap, mComposition, TEST_DATA_DIR)
@@ -65,12 +66,12 @@ def grid(self, mComposerMap, mComposition, TEST_DATA_DIR):
testResult = checker.testComposition( "Composer map grid", mComposition, TEST_DATA_DIR + QDir().separator().toAscii() + "control_images" + QDir().separator().toAscii() + "expected_composermap" + QDir().separator().toAscii() + "composermap_landsat_grid.png" )
mComposerMap.setGridEnabled( False )
mComposerMap.setShowGridAnnotation( False )
mTestName = "gaga"
# myMessage = "<DartMeasurementFile name=\"Rendered Image " + mTestName + "\" type=\"image/png\">" + renderedFilePath + "</DartMeasurementFile> <DartMeasurementFile name=\"Expected Image " + mTestName + "\" type=\"image/png\">" + mExpectedImageFile + "</DartMeasurementFile> <DartMeasurementFile name=\"Difference Image " + mTestName + "\" type=\"image/png\">" + diffFilePath + "</DartMeasurementFile>"
assert testResult == True #, myMessage

assert testResult == True

def overviewMap(self, mComposerMap, mComposition, TEST_DATA_DIR):
overviewMap = QgsComposerMap( mComposition, 20, 130, 70, 70 )
overviewMap.setFrameEnabled( True )
mComposition.addComposerMap( overviewMap )
# zoom in
mComposerMap.setNewExtent( QgsRectangle( 785462.375, 3341423.125, 789262.375, 3343323.125 ) )

0 comments on commit a4c709e

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