diff options
author | kali <kali@leap.se> | 2012-08-08 17:33:47 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-08 17:33:47 +0900 |
commit | 81e0e2bc82757425bebfb659e6c2cb873bc88ec9 (patch) | |
tree | bf8faf83ea2f1a5f43085dff6fc284c54e8dc5df /tests/test_qt_environment.py | |
parent | 3516661f431791b8158179f3a5f87af6b05d85a8 (diff) |
reset tests + run_tests script + very simple first test.
Diffstat (limited to 'tests/test_qt_environment.py')
-rw-r--r-- | tests/test_qt_environment.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/test_qt_environment.py b/tests/test_qt_environment.py new file mode 100644 index 00000000..08fccf4b --- /dev/null +++ b/tests/test_qt_environment.py @@ -0,0 +1,39 @@ +import sys +import unittest + +import sip +sip.setapi('QVariant', 2) + +from PyQt4 import QtGui + + +class TestWin(QtGui.QMainWindow): + """ + a _really_ minimal test window, + with only one tray icon + """ + def __init__(self): + super(TestWin, self).__init__() + self.trayIcon = QtGui.QSystemTrayIcon(self) + + +class QtEnvironTest(unittest.TestCase): + """ + Test we're running a proper qt environment + """ + + def setUp(self): + self.app = QtGui.QApplication(sys.argv) + self.win = TestWin() + + def tearDown(self): + del(self.win) + del(self.app) + + def test_system_has_systray(self): + """ + does system have systray available? + """ + self.assertEqual( + self.win.trayIcon.isSystemTrayAvailable(), + True) |