Skip to content
Permalink
Browse files

Test for multiframe html in python

  • Loading branch information
Marco Hugentobler
Marco Hugentobler committed Aug 30, 2012
1 parent 0386a63 commit 142d80f4198f1fa85223ad164da42853faa4a166
Showing with 7 additions and 11 deletions.
  1. +7 −11 tests/src/python/test_qgscomposerhtml.py
@@ -45,9 +45,6 @@ def table(self):
assert result == True

def tableMultiFrame(self):

assert 1 == 1 # soon...
'''
TEST_DATA_DIR = unitTestDataPath()
htmlItem = QgsComposerHtml( self.mComposition, False )
htmlFrame = QgsComposerFrame( self.mComposition, htmlItem, 10, 10, 100, 50 )
@@ -56,29 +53,28 @@ def tableMultiFrame(self):

htmlItem.setUrl( QUrl( QString( "file:///%1" ).arg( QString( TEST_DATA_DIR ) + QDir.separator() + "html_table.html" ) ) )
nFrames = htmlItem.nFrames()
for i in nFrames:
for i in range( nFrames ):
htmlItem.frame( i ).setFrameEnabled( True )

result = True

#page 1
checker1 = QgsCompositionChecker( "Composer html table", self.mComposition, QString( QString( TEST_DATA_DIR ) + QDir.separator() + "control_images" + QDir.separator() + "expected_composerhtml" + QDir.separator() + "composerhtml_table_multiframe1.png" ) )
if not checker1.testComposition( 0 ):
checker1 = QgsCompositionChecker( )
if not checker1.testComposition( "Composer html table", self.mComposition, QString( QString( TEST_DATA_DIR ) + QDir.separator() + "control_images" + QDir.separator() + "expected_composerhtml" + QDir.separator() + "composerhtml_table_multiframe1.png" ), 0 ):
result = False

checker2 = QgsCompositionChecker( "Composer html table", self.mComposition, QString( QString( TEST_DATA_DIR ) + QDir.separator() + "control_images" + QDir.separator() + "expected_composerhtml" + QDir.separator() + "composerhtml_table_multiframe2.png" ) )
if not checker2.testComposition( 1 ):
checker2 = QgsCompositionChecker( )
if not checker2.testComposition( "Composer html table", self.mComposition, QString( QString( TEST_DATA_DIR ) + QDir.separator() + "control_images" + QDir.separator() + "expected_composerhtml" + QDir.separator() + "composerhtml_table_multiframe2.png" ) , 1 ):
result = False

checker3 = QgsCompositionChecker( "Composer html table", self.mComposition, QString( QString( TEST_DATA_DIR ) + QDir.separator() + "control_images" + QDir.separator() + "expected_composerhtml" + QDir.separator() + "composerhtml_table_multiframe3.png" ) )
if not checker3.testComposition( 2 ):
checker3 = QgsCompositionChecker( )
if not checker3.testComposition( "Composer html table", self.mComposition, QString( QString( TEST_DATA_DIR ) + QDir.separator() + "control_images" + QDir.separator() + "expected_composerhtml" + QDir.separator() + "composerhtml_table_multiframe3.png" ), 2 ):
result = False

self.mComposition.removeMultiFrame( htmlItem )
del htmlItem

assert result == True
'''

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

0 comments on commit 142d80f

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