mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-18 15:33:08 +02:00
Store all modified tasks for use by on-exit hook (#3352)
The on-exit hook gets all modified tasks as input, but this was omitted in the previous release. This adds a test for the desired behavior, and updates TDB2 to correctly store the required information.
This commit is contained in:
parent
7578768d9b
commit
0a491f36ad
3 changed files with 27 additions and 2 deletions
|
@ -56,6 +56,22 @@ class TestHooksOnExit(TestCase):
|
|||
logs = hook.get_logs()
|
||||
self.assertEqual(logs["output"]["msgs"][0], "FEEDBACK")
|
||||
|
||||
def test_onexit_builtin_good_gets_changed_tasks(self):
|
||||
"""on-exit-good - a well-behaved, successful, on-exit hook."""
|
||||
hookname = 'on-exit-good'
|
||||
self.t.hooks.add_default(hookname, log=True)
|
||||
|
||||
code, out, err = self.t("add foo")
|
||||
self.assertIn("Created task", out)
|
||||
|
||||
hook = self.t.hooks[hookname]
|
||||
hook.assertTriggeredCount(1)
|
||||
hook.assertExitcode(0)
|
||||
|
||||
logs = hook.get_logs()
|
||||
self.assertEqual(logs["output"]["msgs"][0], "CHANGED TASK")
|
||||
self.assertEqual(logs["output"]["msgs"][1], "FEEDBACK")
|
||||
|
||||
def test_onexit_builtin_bad(self):
|
||||
"""on-exit-bad - a well-behaved, failing, on-exit hook."""
|
||||
hookname = 'on-exit-bad'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue