summaryrefslogtreecommitdiff
path: root/tests/test_qt_environment.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-08 20:06:14 +0900
committerkali <kali@leap.se>2012-08-08 20:06:14 +0900
commitb1e025a343d0c6019127871acb47d7b295d342e9 (patch)
treeb5d175e1bf8b625433ba8d8ec83cb45b0ccc8618 /tests/test_qt_environment.py
parentc1fa99be4dc4174a34620324ec5056b793196b53 (diff)
parent60a51aed9c1ee9249a79b3d996ae86d93a9532de (diff)
Merge branch 'tests-cleanup' into develop
moved out old broken stuff; copied a run_scripts entry point for tests; created a bunch of (mostly stubs) simple tests on secondary functions.
Diffstat (limited to 'tests/test_qt_environment.py')
-rw-r--r--tests/test_qt_environment.py39
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)