summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/app/tests/test_workflow.py8
-rw-r--r--src/mailman/app/workflow.py7
2 files changed, 11 insertions, 4 deletions
diff --git a/src/mailman/app/tests/test_workflow.py b/src/mailman/app/tests/test_workflow.py
index 99fc47c53..0d0ebc9fc 100644
--- a/src/mailman/app/tests/test_workflow.py
+++ b/src/mailman/app/tests/test_workflow.py
@@ -122,7 +122,15 @@ class TestWorkflow(unittest.TestCase):
results = self._workflow.run_thru('second')
self.assertEqual(results, ['one', 'two'])
+ def test_run_thru_completes(self):
+ results = self._workflow.run_thru('all of them')
+ self.assertEqual(results, ['one', 'two', 'three'])
+
def test_run_until(self):
# Run until (but not including) the given step.
results = self._workflow.run_until('second')
self.assertEqual(results, ['one'])
+
+ def test_run_until_completes(self):
+ results = self._workflow.run_until('all of them')
+ self.assertEqual(results, ['one', 'two', 'three'])
diff --git a/src/mailman/app/workflow.py b/src/mailman/app/workflow.py
index c2762d10d..7508e9b37 100644
--- a/src/mailman/app/workflow.py
+++ b/src/mailman/app/workflow.py
@@ -63,7 +63,7 @@ class Workflow:
name = self._next.popleft()
step = getattr(self, '_step_{}'.format(name))
self._count += 1
- if self.debug:
+ if self.debug: # pragma: no cover
print('[{:02d}] -> {}'.format(self._count, name), file=sys.stderr)
return name, step
@@ -151,6 +151,5 @@ class Workflow:
self._next.clear()
if state.step:
self._next.append(state.step)
- if state.data is not None:
- for attr, value in json.loads(state.data).items():
- setattr(self, attr, value)
+ for attr, value in json.loads(state.data).items():
+ setattr(self, attr, value)