mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Unittest - Test that the task binary used matches the current commit
This commit is contained in:
parent
f24db73a55
commit
d65e9b2594
1 changed files with 13 additions and 0 deletions
|
@ -34,6 +34,7 @@ from datetime import datetime
|
|||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Task, TestCase
|
||||
from basetest.utils import run_cmd_wait
|
||||
|
||||
|
||||
class TestVersion(TestCase):
|
||||
|
@ -49,6 +50,18 @@ class TestVersion(TestCase):
|
|||
expected = "Copyright \(C\) \d{4} - %d" % (datetime.now().year,)
|
||||
self.assertRegexpMatches(out.decode("utf8"), expected)
|
||||
|
||||
def test_task_git_version(self):
|
||||
"""Task binary matches the current git commit"""
|
||||
|
||||
git_cmd = ("git", "rev-parse", "--short", "--verify", "HEAD")
|
||||
_, hash, _ = run_cmd_wait(git_cmd)
|
||||
|
||||
expected = "Commit: {0}".format(hash)
|
||||
|
||||
args = ("diag",)
|
||||
|
||||
code, out, err = self.t(args)
|
||||
self.assertIn(expected, out)
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue