summaryrefslogtreecommitdiff
path: root/tests/glibext/work.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-06-21 22:26:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-06-21 22:26:13 (GMT)
commitd49b837c891e0490167b51c4a9811cb2e8276588 (patch)
tree9bc499f2d7077a0e715b88c8c71dca1691b6c1df /tests/glibext/work.py
parentfde070b3d2392333fffec6ac6eff3647dacd8b80 (diff)
Restore and improve work queues.gtk4
Diffstat (limited to 'tests/glibext/work.py')
-rw-r--r--tests/glibext/work.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/glibext/work.py b/tests/glibext/work.py
new file mode 100644
index 0000000..808e25e
--- /dev/null
+++ b/tests/glibext/work.py
@@ -0,0 +1,26 @@
+
+from chrysacase import ChrysalideTestCase
+from pychrysalide.glibext import GenericWork
+
+
+class TestWorks(ChrysalideTestCase):
+ """TestCase for glibext.GenericWork"""
+
+ def testBasicWorkImplementation(self):
+ """Implement a basic work."""
+
+ class BasicWork(GenericWork):
+ def __init__(self, lst):
+ super(BasicWork, self).__init__()
+ self._lst = lst
+ def _run(self):
+ self._lst.append('done')
+
+ test = []
+
+ work = BasicWork(test)
+
+ work.process()
+
+ self.assertEqual(len(test), 1)
+ self.assertEqual(test[0], 'done')