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:

```
from qgis.utils import iface
IFACE = iface
```

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.

Regards

On Sat, Jun 27, 2015 at 5:44 AM, Tom Chadwin <tom.chad...@nnpa.org.uk>
wrote:

> I suspect I'm not going to get this to work. I hit the problem that my
> plugin
> 's code used iface, which was not recognised. I managed to inject the dummy
> iface replacement created in the qgis_get_app () function mentioned above.
> However, next the code calls:
>
> ```python
> IFACE.legendInterface().groupLayerRelationship()
>
> ```
>
> While the dummy iface implements a method legendInterface(), it's just a
> stub. It doesn't even return the right object type, but returns a canvas
> object instead.
>
> I might be able to expand the dummy iface to add in the extra features
> required to get the right object type returned by that method, but isn't
> this all pointless?
>
> - the more dummy object I have to build, the less real object I am testing
>
> - the dummy won't have the session data associated with it, such as the
> project's layers
>
> An I misunderstanding something, or is my attempt to set up testing for
> qgis2web doomed?
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213199.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*-------------------*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to