summaryrefslogtreecommitdiff
path: root/src/leap/gui/tests/test_threads.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-30 04:46:55 +0900
committerkali <kali@leap.se>2012-12-12 04:27:50 +0900
commitff6d4b8633edc763f22489030766a6c7a9377693 (patch)
tree6f35a3d1114874abc331a79c73bc927097d30156 /src/leap/gui/tests/test_threads.py
parentb262ac8bae66c391aa249e93268db9935f1c475f (diff)
progress initial tests
Diffstat (limited to 'src/leap/gui/tests/test_threads.py')
-rw-r--r--src/leap/gui/tests/test_threads.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/leap/gui/tests/test_threads.py b/src/leap/gui/tests/test_threads.py
new file mode 100644
index 00000000..06c19606
--- /dev/null
+++ b/src/leap/gui/tests/test_threads.py
@@ -0,0 +1,27 @@
+import unittest
+
+import mock
+from leap.gui import threads
+
+
+class FunThreadTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.fun = mock.MagicMock()
+ self.fun.return_value = "foo"
+ self.t = threads.FunThread(fun=self.fun)
+
+ def test_thread(self):
+ self.t.begin()
+ self.t.wait()
+ self.fun.assert_called()
+ del self.t
+
+ def test_run(self):
+ # this is called by PyQt
+ self.t.run()
+ del self.t
+ self.fun.assert_called()
+
+if __name__ == "__main__":
+ unittest.main()