mirror of
https://github.com/GothenburgBitFactory/task-timewarrior-hook.git
synced 2025-09-05 23:17:21 +02:00
Rename hook script to on_modify.py
Rename test accordingly
This commit is contained in:
parent
b2d78bb677
commit
431db0fb84
2 changed files with 5 additions and 13 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2016 - 2021, Thomas Lauf, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2016 - 2021, Gothenburg Bit Factory
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -26,13 +26,11 @@
|
|||
#
|
||||
###############################################################################
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Hook should extract all of the following for use as Timewarrior tags:
|
||||
# Hook should extract all the following for use as Timewarrior tags:
|
||||
# UUID
|
||||
# Project
|
||||
# Tags
|
|
@ -29,20 +29,19 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from basetest import Timew, TestCase
|
||||
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Timew, TestCase
|
||||
|
||||
|
||||
class TestOnModifyHookScript(TestCase):
|
||||
def setUp(self):
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
self.t = Timew()
|
||||
|
||||
self.process = subprocess.Popen([os.path.join(current_dir, '../on-modify.timewarrior')],
|
||||
self.process = subprocess.Popen([os.path.join(current_dir, '../on_modify.py')],
|
||||
env={
|
||||
'PATH': '../src:' + os.environ['PATH'],
|
||||
'TIMEWARRIORDB': self.t.datadir
|
||||
|
@ -215,8 +214,3 @@ class TestOnModifyHookScript(TestCase):
|
|||
j = self.t.export()
|
||||
self.assertEqual(len(j), 1)
|
||||
self.assertClosedInterval(j[0], expectedTags=["Foo"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
Loading…
Add table
Add a link
Reference in a new issue