Beispiel #1
0
    def Xtest_renderTemplate(self):
        """Test that load template works"""
        # Use the template from our resources bundle
        myInPath = ":/plugins/inasafe/basic.qpt"
        myLayer, _ = load_layer("test_shakeimpact.shp")

        myCanvasLayer = QgsMapCanvasLayer(myLayer)
        CANVAS.setLayerSet([myCanvasLayer])
        myMap = Map(IFACE)
        set_jakarta_extent()
        myMap.set_impact_layer(myLayer)
        myPath = unique_filename(prefix="outTemplate", suffix=".pdf", dir=temp_dir("test"))
        LOGGER.debug(myPath)
        myMap.render_template(myInPath, myPath)
        assert os.path.exists(myPath)
Beispiel #2
0
    def Xtest_renderTemplate(self):
        """Test that load template works"""
        #Use the template from our resources bundle
        myInPath = ':/plugins/inasafe/basic.qpt'
        myLayer, _ = load_layer('test_shakeimpact.shp')

        myCanvasLayer = QgsMapCanvasLayer(myLayer)
        CANVAS.setLayerSet([myCanvasLayer])
        myMap = Map(IFACE)
        set_jakarta_extent()
        myMap.set_impact_layer(myLayer)
        myPath = unique_filename(prefix='outTemplate',
                                 suffix='.pdf',
                                 dir=temp_dir('test'))
        LOGGER.debug(myPath)
        myMap.render_template(myInPath, myPath)
        assert os.path.exists(myPath)