Rename hook script to on_modify.py

Rename test accordingly
This commit is contained in:
Thomas Lauf 2021-06-05 21:14:21 +02:00
parent b2d78bb677
commit 431db0fb84
2 changed files with 5 additions and 13 deletions

View file

@ -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 # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -26,13 +26,11 @@
# #
############################################################################### ###############################################################################
from __future__ import print_function
import json import json
import subprocess import subprocess
import sys 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 # UUID
# Project # Project
# Tags # Tags

View file

@ -29,20 +29,19 @@
import os import os
import subprocess import subprocess
import sys import sys
import unittest
from basetest import Timew, TestCase
# Ensure python finds the local simpletap module # Ensure python finds the local simpletap module
sys.path.append(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from basetest import Timew, TestCase
class TestOnModifyHookScript(TestCase): class TestOnModifyHookScript(TestCase):
def setUp(self): def setUp(self):
current_dir = os.path.dirname(os.path.abspath(__file__)) current_dir = os.path.dirname(os.path.abspath(__file__))
self.t = Timew() 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={ env={
'PATH': '../src:' + os.environ['PATH'], 'PATH': '../src:' + os.environ['PATH'],
'TIMEWARRIORDB': self.t.datadir 'TIMEWARRIORDB': self.t.datadir
@ -215,8 +214,3 @@ class TestOnModifyHookScript(TestCase):
j = self.t.export() j = self.t.export()
self.assertEqual(len(j), 1) self.assertEqual(len(j), 1)
self.assertClosedInterval(j[0], expectedTags=["Foo"]) self.assertClosedInterval(j[0], expectedTags=["Foo"])
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner())