Skip to content

Commit

Permalink
Fake statusbar for tests.
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@305 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Jul 22, 2012
1 parent aa3d766 commit b7a9e21
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/sextante/tests/qgis_interface.py
Expand Up @@ -41,6 +41,12 @@ def __init__(self, canvas):
self.canvas = canvas
self.testRaster = QgsRasterLayer('data/raster', "raster")
self.testVector = QgsVectorLayer('data/vector', "vector", 'ogr')
QgsMapLayerRegistry.instance().addMapLayer(self.testRaster)
QgsMapLayerRegistry.instance().addMapLayer(self.testVector)

self.statusBar = type('FakeStatusBar', (),
{'showMessage' : lambda _, m: None
})()

def zoomFull(self):
"""Zoom to the map full extent"""
Expand Down Expand Up @@ -89,7 +95,10 @@ def mainWindow(self):
In case of QGIS it returns an instance of QgisApp
"""
pass
return type('FakeMainWindow', (),
{'statusBar' :
lambda _: self.statusBar
})()

def addDockWidget(self, area, dockwidget):
""" Add a dock widget to the main window """
Expand Down

0 comments on commit b7a9e21

Please sign in to comment.