mirror of
https://github.com/GothenburgBitFactory/task-timewarrior-hook.git
synced 2025-06-26 10:54:27 +02:00
Mark byte literals
- #259 Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
93aa943a7d
commit
eb9fb2bdc5
1 changed files with 22 additions and 22 deletions
|
@ -56,12 +56,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task annotate'"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"3495a755-c4c6-4106-aabe-c0d3d128b65a"}
|
||||
{"description":"Foo","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"3495a755-c4c6-4106-aabe-c0d3d128b65a","annotations":[{"entry":"20190820T201911Z","description":"Annotation"}]}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -71,12 +71,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task append'"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"da603270-ce2b-4a5a-9273-c67c2d2d0067"}
|
||||
{"description":"Foo Bar","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"da603270-ce2b-4a5a-9273-c67c2d2d0067"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -86,12 +86,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task delete'"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"25b66283-96e0-42b4-b835-8efd0ea1043c"}
|
||||
{"description":"Foo","end":"20190820T201911Z","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"deleted","uuid":"25b66283-96e0-42b4-b835-8efd0ea1043c"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -102,12 +102,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
self.t("start 10min ago Foo")
|
||||
self.t("annotate @1 Annotation")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"8811cc93-a495-4fa6-993e-2b96cffc48e0","annotations":[{"entry":"20190820T201911Z","description":"Annotation"}]}
|
||||
{"description":"Foo","entry":"20190820T201911Z","modified":"20190820T201911Z","start":"20190820T201911Z","status":"pending","uuid":"8811cc93-a495-4fa6-993e-2b96cffc48e0"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -117,12 +117,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task done'"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T201912Z","modified":"20190820T201912Z","start":"20190820T201912Z","status":"pending","uuid":"c418b958-5c3c-4633-89a4-4a2f678d74d0"}
|
||||
{"description":"Foo","end":"20190820T201912Z","entry":"20190820T201912Z","modified":"20190820T201912Z","status":"completed","uuid":"c418b958-5c3c-4633-89a4-4a2f678d74d0"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(b'', err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -132,12 +132,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task modify' for changing description"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T203416Z","modified":"20190820T203416Z","start":"20190820T203416Z","status":"pending","uuid":"189e6745-04e0-4b17-949f-900cf63ab8d9"}
|
||||
{"description":"Bar","entry":"20190820T203416Z","modified":"20190820T203416Z","start":"20190820T203416Z","status":"pending","uuid":"189e6745-04e0-4b17-949f-900cf63ab8d9"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -147,12 +147,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task modify' for changing tags"""
|
||||
self.t("start 10min ago Foo Tag Bar")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T203620Z","modified":"20190820T203620Z","start":"20190820T203620Z","status":"pending","tags":["Tag","Bar"],"uuid":"6cab88f0-ac12-4a87-995a-0e7d39810c05"}
|
||||
{"description":"Foo","entry":"20190820T203620Z","modified":"20190820T203620Z","start":"20190820T203620Z","status":"pending","tags":["Tag","Baz"],"uuid":"6cab88f0-ac12-4a87-995a-0e7d39810c05"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -162,12 +162,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task modify' for changing project"""
|
||||
self.t("start Foo dummy")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","project":"dummy","start":"20190820T203842Z","status":"pending","uuid":"d95dc7a0-6189-4692-b58a-4ab60d539c8d"}
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","project":"test","start":"20190820T203842Z","status":"pending","uuid":"d95dc7a0-6189-4692-b58a-4ab60d539c8d"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(b'', err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -177,12 +177,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task prepend'"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","start":"20190820T203842Z","status":"pending","uuid":"02bc8839-b304-49f9-ac1a-29ac4850583f"}
|
||||
{"description":"Prefix Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","start":"20190820T203842Z","status":"pending","uuid":"02bc8839-b304-49f9-ac1a-29ac4850583f"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -190,12 +190,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
|
||||
def test_hook_should_process_start(self):
|
||||
"""on-modify hook should process 'task start'"""
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","status":"pending","uuid":"16af44c5-57d2-43bf-97ed-cf2e541d927f"}
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","start":"20190820T203842Z","status":"pending","uuid":"16af44c5-57d2-43bf-97ed-cf2e541d927f"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
@ -205,12 +205,12 @@ class TestOnModifyHookScript(TestCase):
|
|||
"""on-modify hook should process 'task stop'"""
|
||||
self.t("start 10min ago Foo")
|
||||
|
||||
out, err = self.process.communicate(input="""\
|
||||
out, err = self.process.communicate(input=b"""\
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","start":"20190820T203842Z","status":"pending","uuid":"13f83e99-f6a2-4857-9e00-bdeede064772"}
|
||||
{"description":"Foo","entry":"20190820T203842Z","modified":"20190820T203842Z","status":"pending","uuid":"13f83e99-f6a2-4857-9e00-bdeede064772"}
|
||||
""")
|
||||
|
||||
self.assertEqual('', err)
|
||||
self.assertEqual(bytes(b''), err)
|
||||
|
||||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue