Ejemplo n.º 1
0
     (at your option) any later version.

"""

__author__ = '*****@*****.**'
__date__ = '2015-09-13'
__copyright__ = 'Copyright 2015, Tomasz Hak'

import unittest

from PyQt4.QtGui import QDialogButtonBox, QDialog

from MPZPInfo_dialog import mpzpDialog

from utilities import get_qgis_app
QGIS_APP = get_qgis_app()


class mpzpDialogTest(unittest.TestCase):
    """Test dialog works."""

    def setUp(self):
        """Runs before each test."""
        self.dialog = mpzpDialog(None)

    def tearDown(self):
        """Runs after each test."""
        self.dialog = None

    def test_dialog_ok(self):
        """Test we can click OK."""
     (at your option) any later version.

"""

__author__ = '*****@*****.**'
__date__ = '2017-02-03'
__copyright__ = 'Copyright 2017, University of Reading'

import unittest

from PyQt4.QtGui import QDialogButtonBox, QDialog

from LCZ_converter_dialog import LCZ_testDialog

from utilities import get_qgis_app
QGIS_APP = get_qgis_app()


class LCZ_testDialogTest(unittest.TestCase):
    """Test dialog works."""
    def setUp(self):
        """Runs before each test."""
        self.dialog = LCZ_testDialog(None)

    def tearDown(self):
        """Runs after each test."""
        self.dialog = None

    def test_dialog_ok(self):
        """Test we can click OK."""
Ejemplo n.º 3
0
__date__ = '2015-03-26'
__copyright__ = 'Copyright 2015, Riccardo Klinger / Geolicious'

import unittest

# This import is to enable SIP API V2
# noinspection PyUnresolvedReferences
import qgis  # pylint: disable=unused-import
from qgis.core import QgsProject
from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
from PyQt4 import QtCore, QtTest
from PyQt4.QtCore import *
from PyQt4.QtGui import QDialogButtonBox, QDialog
from utilities import get_qgis_app

QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()

from maindialog import MainDialog

class qgis2web_classDialogTest(unittest.TestCase):
    """Test most common plugin actions"""

    def setUp(self):
        """Runs before each test"""
        self.dialog = MainDialog(IFACE)
        self.dialog.paramsTreeOL.itemWidget(self.dialog.paramsTreeOL.findItems("Template",
                                                (Qt.MatchExactly |
                                                 Qt.MatchRecursive))[0], 1).setCurrentIndex(1)

    def tearDown(self):
        """Runs after each test"""
Ejemplo n.º 4
0
__copyright__ = 'Copyright 2017, Nyall Dawson'

import unittest

# This import is to enable SIP API V2
# noinspection PyUnresolvedReferences
import qgis  # pylint: disable=unused-import

from utilities import get_qgis_app
from qgis.core import (QgsProject)
from writerRegistry import (WRITER_REGISTRY)
from olwriter import (OpenLayersWriter)
from leafletWriter import (LeafletWriter)
from configparams import (getDefaultParams)

QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app()


class qgis2web_writerRegistryTest(unittest.TestCase):
    """Test writer registry"""
    def setUp(self):
        """Runs before each test"""
        pass

    def test01_RegistryHasExporters(self):
        """test that writer registry is populated with writers"""
        self.assertTrue(OpenLayersWriter in WRITER_REGISTRY.getWriters())

    def test02_SaveRestoreWriterTypeFromProject(self):
        """Test saving and restoring writer type from project"""
        WRITER_REGISTRY.saveTypeToProject(OpenLayersWriter.type())