taskwarrior/test/test_hooks/on-modify-for-template-badexit.py
Max Rossmannek f35989be0e Enforce Python 3 for unittests
This commit updates all tests to enforce the Python3 executable. This is
necessary because the `assertRegex` function we use was renamed to this
name only in Python 3.2 [1]

For reference:
s;/usr/bin/env python;/usr/bin/env python3;g

[1]: https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRegex
2020-11-30 00:51:54 -05:00

19 lines
409 B
Python

#!/usr/bin/env python3
# -*- 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