From 81e0e2bc82757425bebfb659e6c2cb873bc88ec9 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 8 Aug 2012 17:33:47 +0900 Subject: reset tests + run_tests script + very simple first test. --- tests/test_qt_environment.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/test_qt_environment.py (limited to 'tests/test_qt_environment.py') 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) -- cgit v1.2.3 From 6fcbd68152689f98d9c5b7526eee2e1e9b7dd0a2 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 22 Aug 2012 04:52:31 +0900 Subject: minor tweaks to setup + env test --- tests/test_qt_environment.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/test_qt_environment.py') diff --git a/tests/test_qt_environment.py b/tests/test_qt_environment.py index 08fccf4b..d97322b9 100644 --- a/tests/test_qt_environment.py +++ b/tests/test_qt_environment.py @@ -37,3 +37,7 @@ class QtEnvironTest(unittest.TestCase): self.assertEqual( self.win.trayIcon.isSystemTrayAvailable(), True) + + +if __name__ == "__main__": + unittest.main() -- cgit v1.2.3 From 8a8919eb2f9efc704dbe06601c375f77526b54d3 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 25 Jan 2013 04:56:37 +0900 Subject: remove pep8 from tox run and remove sip api setting from the qt smoke test --- tests/test_qt_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_qt_environment.py') diff --git a/tests/test_qt_environment.py b/tests/test_qt_environment.py index d97322b9..e90d527f 100644 --- a/tests/test_qt_environment.py +++ b/tests/test_qt_environment.py @@ -2,7 +2,7 @@ import sys import unittest import sip -sip.setapi('QVariant', 2) +#sip.setapi('QVariant', 2) from PyQt4 import QtGui -- cgit v1.2.3