Skip to content

Commit b7a9e21

Browse files
author
cpolymeris@gmail.com
committed
Fake statusbar for tests.
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@305 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent aa3d766 commit b7a9e21

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/sextante/tests/qgis_interface.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ def __init__(self, canvas):
4141
self.canvas = canvas
4242
self.testRaster = QgsRasterLayer('data/raster', "raster")
4343
self.testVector = QgsVectorLayer('data/vector', "vector", 'ogr')
44+
QgsMapLayerRegistry.instance().addMapLayer(self.testRaster)
45+
QgsMapLayerRegistry.instance().addMapLayer(self.testVector)
46+
47+
self.statusBar = type('FakeStatusBar', (),
48+
{'showMessage' : lambda _, m: None
49+
})()
4450

4551
def zoomFull(self):
4652
"""Zoom to the map full extent"""
@@ -89,7 +95,10 @@ def mainWindow(self):
8995
9096
In case of QGIS it returns an instance of QgisApp
9197
"""
92-
pass
98+
return type('FakeMainWindow', (),
99+
{'statusBar' :
100+
lambda _: self.statusBar
101+
})()
93102

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

0 commit comments

Comments
 (0)