Exemple #1
0
 def setUp(self):
     """Runs before each test."""
     QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()
     self.iface = IFACE
     self.dialog = TrendMapperDialog(self.iface)
     self.layer_yearly = QgsVectorLayer('./test/test_noaa_yearly.sqlite',
                                        'test_noaa_yearly', 'ogr')
     self.layer_monthly = QgsVectorLayer('./test/test_noaa_monthly.sqlite',
                                         'test_noaa_monthly', 'ogr')
     QgsMapLayerRegistry.instance().addMapLayer(self.layer_yearly)
     QgsMapLayerRegistry.instance().addMapLayer(self.layer_monthly)
"""
__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 test.utilities import get_qgis_app

QGIS_APP = get_qgis_app()


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

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

        r = QgsProviderRegistry.instance()
        self.assertIn('gdal', r.providerList())
        self.assertIn('ogr', r.providerList())
        self.assertIn('postgres', r.providerList())

    def test_projection(self):
        """Test that QGIS properly parses a wkt string.
Exemple #3
0
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

"""
__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 test.utilities import get_qgis_app
QGIS_APP = get_qgis_app()


class QGISTest(unittest.TestCase):
    """Test the QGIS Environment"""
    def test_qgis_environment(self):
        """QGIS environment has the expected providers"""

        r = QgsProviderRegistry.instance()
        self.assertIn('gdal', r.providerList())
        self.assertIn('ogr', r.providerList())
        self.assertIn('postgres', r.providerList())

    def test_projection(self):
        """Test that QGIS properly parses a wkt string.
        """
Exemple #4
0
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
"""

import unittest

# This import is to enable SIP API V2
# noinspection PyUnresolvedReferences
import qgis  # pylint: disable=unused-import
from test.utilities import get_qgis_app
QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()

from qgis.core import QgsRectangle

from QuickOSM.core.query_parser import (
    is_oql,
    replace_center,
    replace_bbox,
    replace_geocode_area,
    replace_geocode_coords,
    clean_query,
    prepare_query
)


class TestQueryParser(unittest.TestCase):
Exemple #5
0
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
"""

import unittest

# This import is to enable SIP API V2
# noinspection PyUnresolvedReferences
import qgis  # pylint: disable=unused-import
from test.utilities import get_qgis_app
QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()

from qgis.core import QgsRectangle

from QuickOSM.core.query_parser import (
    is_oql,
    replace_center,
    replace_bbox,
    replace_geocode_area,
    replace_geocode_coords,
    clean_query,
    prepare_query
)


class TestQueryParser(unittest.TestCase):