Пример #1
0
                              isLayerPolygonal,
                              getLayerAttributeNames,
                              impactLayerAttribution,
                              dpiToMeters,
                              _addMinMaxToStyle)
from safe_qgis.utilities_test import (unitTestDataPath,
                                     loadLayer,
                                     getQgisTestApp)
from safe_qgis.exceptions import StyleError
from safe.common.exceptions import BoundingBoxError
from safe_qgis.test_keywords_dialog import (makePolygonLayer,
                                            makePadangLayer,
                                            makePointLayer)
from safe_qgis.utilities import getDefaults

QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()


class UtilitiesTest(unittest.TestCase):
    """Tests for reading and writing of raster and vector data
    """

    def setUp(self):
        os.environ['LANG'] = 'en'

    def tearDown(self):
        pass

    def test_stacktrace_html(self):
        """Stack traces can be caught and rendered as html
        """
Пример #2
0
__author__ = '*****@*****.**'
__date__ = '20/01/2011'
__copyright__ = ('Copyright 2012, Australia Indonesia Facility for '
                 'Disaster Reduction')

import os
import unittest
from qgis.core import (
    QgsProviderRegistry,
    QgsCoordinateReferenceSystem,
    QgsRasterLayer)
from safe_qgis.utilities_test import getQgisTestApp
from safe_interface import EXPDATA

QGISAPP = getQgisTestApp()


class QGISTest(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()
from PyQt4.QtGui import QLineEdit

# Add PARENT directory to path to make test aware of other modules
pardir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(pardir)

from safe.impact_functions import get_plugins

from safe_qgis.function_options_dialog import FunctionOptionsDialog
from safe_qgis.utilities_test import getQgisTestApp
# pylint: disable=W0611
from safe.engine.impact_functions_for_testing.itb_fatality_model_configurable\
    import ITBFatalityFunctionConfigurable
# pylint: enable=W0611

QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()
LOGGER = logging.getLogger('InaSAFE')


class FunctionOptionsDialogTest(unittest.TestCase):
    """Test the InaSAFE GUI for Configurable Impact Functions"""
    def setUp(self):
        """Fixture run before all tests"""
        pass

    def tearUp(self):
        """Fixture run before each test"""
        pass

    def tearDown(self):
        """Fixture run after each test"""