'Disaster Reduction')

import unittest

from nose import SkipTest

# this import required to enable PyQt API v2
import qgis  # pylint: disable=W0611

from PyQt4.QtGui import QDialogButtonBox

from safe_qgis.tools.function_browser import FunctionBrowser
from safe_qgis.utilities.utilities_for_testing import get_qgis_app


QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()


def verifyColumn(table, col, strFilter, mode):
    """Helper function to verify the element in column.

        :param table: Table to be verified.

        :param col: Column number.
        :type col: int

        :param strFilter: A filter string.
        :type strFilter: str

        :param mode: Filter mode one of enum(only, included, excluded).
"""

__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.utilities_for_testing import get_qgis_app
from safe_qgis.safe_interface import EXPDATA

QGIS_APP = get_qgis_app()


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()
        assert 'postgres' in r.providerList()
Beispiel #3
0
sys.path.append(pardir)

from safe_qgis.utilities.styling import (
    set_vector_graduated_style,
    setRasterStyle,
    add_extrema_to_style,
    mmi_colour)
from safe_qgis.utilities.utilities import get_error_message
from safe_qgis.utilities.utilities_for_testing import (
    test_data_path,
    load_layer,
    get_qgis_app)
from safe_qgis.exceptions import StyleError
from safe_qgis.safe_interface import BoundingBoxError, bbox_intersection

QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()


class StylingTest(unittest.TestCase):
    """Tests for qgis styling related functions.
    """

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

    def tearDown(self):
        pass

    def test_issue126(self):
        """Test that non integer transparency ranges fail gracefully.
        .. seealso:: https://github.com/AIFDR/inasafe/issues/126
__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.utilities_for_testing import get_qgis_app
from safe_qgis.safe_interface import EXPDATA

QGISAPP = get_qgis_app()


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()
"""

__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.utilities_for_testing import get_qgis_app
from safe_qgis.safe_interface import EXPDATA

QGISAPP = get_qgis_app()


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()
        assert 'postgres' in r.providerList()
__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.utilities_for_testing import get_qgis_app
from safe_qgis.safe_interface import EXPDATA

QGIS_APP = get_qgis_app()


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()