<div dir="ltr"><div><div><div>You can also use iface object provided by Python wrapper from qgis.utils. So in get_qgis_app instead of having the mock QgisInterface, you can do something like:<br><br>```<br></div>from qgis.utils import iface<br></div>IFACE = iface<br>```<br><br></div><div>I think in InaSAFE, we don't want unnecessary implementations from the iface from qgis.utils. I am not aware of the first history of it though.<br><br></div><div>Regards<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 27, 2015 at 5:44 AM, Tom Chadwin <span dir="ltr"><<a href="mailto:tom.chadwin@nnpa.org.uk" target="_blank">tom.chadwin@nnpa.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I suspect I'm not going to get this to work. I hit the problem that my plugin<br>
's code used iface, which was not recognised. I managed to inject the dummy<br>
iface replacement created in the qgis_get_app () function mentioned above.<br>
However, next the code calls:<br>
<br>
```python<br>
IFACE.legendInterface().groupLayerRelationship()<br>
<br>
```<br>
<br>
While the dummy iface implements a method legendInterface(), it's just a<br>
stub. It doesn't even return the right object type, but returns a canvas<br>
object instead.<br>
<br>
I might be able to expand the dummy iface to add in the extra features<br>
required to get the right object type returned by that method, but isn't<br>
this all pointless?<br>
<br>
- the more dummy object I have to build, the less real object I am testing<br>
<br>
- the dummy won't have the session data associated with it, such as the<br>
project's layers<br>
<br>
An I misunderstanding something, or is my attempt to set up testing for<br>
qgis2web doomed?<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213199.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213199.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><p><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-------------------</span></b></p><b>Akbar Gumbira<br></b></div><b>Software Engineer</b><br><b>Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence</b></div></div>
</div>