class PosiViewDialogTest(unittest.TestCase):
    """Test dialog works."""
    def setUp(self):
        """Runs before each test."""
        proj = PosiViewProject({})
        self.dialog = PosiviewProperties(proj, None)

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

    def test_dialog_ok(self):
        """Test we can click OK."""

        button = self.dialog.buttonBox.button(QDialogButtonBox.Ok)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Accepted)

    def test_dialog_cancel(self):
        """Test we can click cancel."""
        button = self.dialog.buttonBox.button(QDialogButtonBox.Cancel)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Rejected)

    def test_dialog_apply(self):
        """Test we can click apply."""
        button = self.dialog.buttonBox.button(QDialogButtonBox.Apply)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Rejected)
class PosiViewDialogTest(unittest.TestCase):
    """Test dialog works."""

    def setUp(self):
        """Runs before each test."""
        proj = PosiViewProject({})
        self.dialog = PosiviewProperties(proj, None)

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

    def test_dialog_ok(self):
        """Test we can click OK."""

        button = self.dialog.buttonBox.button(QDialogButtonBox.Ok)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Accepted)

    def test_dialog_cancel(self):
        """Test we can click cancel."""
        button = self.dialog.buttonBox.button(QDialogButtonBox.Cancel)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Rejected)

    def test_dialog_apply(self):
        """Test we can click apply."""
        button = self.dialog.buttonBox.button(QDialogButtonBox.Apply)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Rejected)
 def setUp(self):
     """Runs before each test."""
     proj = PosiViewProject({})
     self.dialog = PosiviewProperties(proj, None)
Beispiel #4
0
 def configure(self):
     '''Execute the configuration dialogue and apply properties if accepted
     '''
     propDlg = PosiviewProperties(self.project, self.iface.mainWindow())
     propDlg.applyChanges.connect(self.onApplyConfigChanges)
     propDlg.exec_()
 def setUp(self):
     """Runs before each test."""
     proj = PosiViewProject({})
     self.dialog = PosiviewProperties(proj, None)