Пример #1
0
from gui.utilities_test import (getQgisTestApp,
                                assertHashForFile,
                                hashForFile,
                                assertHashesForFile)
from gui.is_map import ISMap
from gui.utilities_test import (loadLayer, setJakartaGeoExtent)
from gui.is_utilities import getTempDir
try:
    from pydevd import *  # pylint: disable=F0401
    print 'Remote debugging is enabled.'
    DEBUG = True
except ImportError:
    print 'Debugging was disabled'

QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()


class ISMapTest(unittest.TestCase):
    """Test the InaSAFE Map generator"""
    def setUp(self):
        """Setup fixture run before each tests"""
        myRegistry = QgsMapLayerRegistry.instance()
        for myLayer in myRegistry.mapLayers():
            myRegistry.removeMapLayer(myLayer)

    def test_inasafeMap(self):
        """Test making a pdf using the ISMap class."""
        myLayer, myType = loadLayer('test_shakeimpact.shp')
        del myType
        myCanvasLayer = QgsMapCanvasLayer(myLayer)
Пример #2
0
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

"""

__author__ = "*****@*****.**"
__version__ = "0.5.0"
__date__ = "20/01/2011"
__copyright__ = "Copyright 2012, Australia Indonesia Facility for " "Disaster Reduction"

import unittest
from qgis.core import QgsProviderRegistry
from gui.utilities_test import getQgisTestApp

QGISAPP = getQgisTestApp()


class ISTest(unittest.TestCase):
    """Test the QGIS Environment"""

    def test_QGISEnvironment(self):
        """QGIS environment has the expected providers"""

        r = QgsProviderRegistry.instance()
        # for item in r.providerList():
        #    print str(item)

        # print 'Provider count: %s' % len(r.providerList())
        assert "gdal" in r.providerList()
        assert "ogr" in r.providerList()