source: orange/Orange/OrangeCanvas/application/tests/test_welcomedialog.py @ 11119:9642f8570adf

Revision 11119:9642f8570adf, 1.1 KB checked in by Ales Erjavec <ales.erjavec@…>, 18 months ago (diff)

Added a Welcome screen dialog widget.

Line 
1"""
2Test for welcome screen.
3"""
4
5from PyQt4.QtGui import QAction
6
7from ...resources import icon_loader
8
9from ..welcomedialog import WelcomeDialog, decorate_welcome_icon
10
11from ...gui.test import QAppTestCase
12
13
14class TestDialog(QAppTestCase):
15    def test_dialog(self):
16        d = WelcomeDialog()
17        loader = icon_loader()
18        icon = loader.get("icons/default-widget.svg")
19        action1 = QAction(decorate_welcome_icon(icon, "light-green"),
20                          "one", self.app)
21        action2 = QAction(decorate_welcome_icon(icon, "orange"),
22                          "two", self.app)
23        d.addRow([action1, action2])
24
25        action3 = QAction(decorate_welcome_icon(icon, "light-green"),
26                          "three", self.app)
27        d.addRow([action3])
28
29        self.assertTrue(d.buttonAt(1, 0).defaultAction() == action3)
30
31        d.show()
32        action = [None]
33
34        def p(a):
35            print str(a.text())
36            action[0] = a
37
38        d.triggered.connect(p)
39        self.app.exec_()
40        self.assertIs(action[0], d.triggeredAction())
Note: See TracBrowser for help on using the repository browser.