diff --git a/on-modify.timewarrior b/on_modify.py similarity index 94% rename from on-modify.timewarrior rename to on_modify.py index 46d82a9..f7afd3c 100755 --- a/on-modify.timewarrior +++ b/on_modify.py @@ -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 diff --git a/test/test_on-modify.timewarrior.py b/test/test_on-modify.py similarity index 98% rename from test/test_on-modify.timewarrior.py rename to test/test_on-modify.py index b958d3f..a6e967f 100755 --- a/test/test_on-modify.timewarrior.py +++ b/test/test_on-modify.py @@ -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())