summaryrefslogtreecommitdiff
path: root/tests/glibext/work.py
diff options
context:
space:
mode:
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')