mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unittest - Template updated to include hook test examples
This commit is contained in:
parent
db78851b40
commit
d68fa7ea8a
3 changed files with 125 additions and 0 deletions
19
test/test_hooks/on-modify-for-template-badexit.py
Normal file
19
test/test_hooks/on-modify-for-template-badexit.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
original_task = sys.stdin.readline()
|
||||
modified_task = sys.stdin.readline()
|
||||
|
||||
task = json.loads(modified_task)
|
||||
task["description"] = "This is an example modify hook"
|
||||
|
||||
# A random message
|
||||
sys.stdout.write("Hello from the template hook\n")
|
||||
|
||||
sys.stdout.write(json.dumps(task, separators=(',', ':')) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
# vim: ai sts=4 et sw=4
|
Loading…
Add table
Add a link
Reference in a new issue