Exemplo n.º 1
0
    def test_renderTemplate(self):
        """Test that load template works"""
        #Use the template from our resources bundle
        myInPath = ':/plugins/inasafe/basic.qpt'
        myLayer, myType = loadLayer('test_shakeimpact.shp')
        del myType

        myCanvasLayer = QgsMapCanvasLayer(myLayer)
        CANVAS.setLayerSet([myCanvasLayer])
        myMap = ISMap(IFACE)
        setJakartaGeoExtent()
        myMap.setImpactLayer(myLayer)
        myOutPath = os.path.join(getTempDir(), 'outTemplate.pdf')
        if os.path.exists(myOutPath):
            os.remove(myOutPath)
        myMap.renderTemplate(myInPath, myOutPath)
        assert os.path.exists(myOutPath)