mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Test: Merged tw-1445.t into alias.t
This commit is contained in:
parent
5f641824fd
commit
ce0bea73e5
2 changed files with 22 additions and 64 deletions
22
test/alias.t
22
test/alias.t
|
@ -29,6 +29,7 @@
|
|||
import sys
|
||||
import os
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
@ -190,6 +191,27 @@ class TestBug1031(TestCase):
|
|||
self.assertRegexpMatches(out, expected)
|
||||
|
||||
|
||||
class Test1445(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
|
||||
def test_alias_single_word(self):
|
||||
"""1445: Verify single-word aliases"""
|
||||
self.t.config('alias.when', 'execute date')
|
||||
code, out, err = self.t('when')
|
||||
self.assertEqual(0, code, "Exit code was non-zero ({0})".format(code))
|
||||
self.assertIn(str(datetime.now().year), out)
|
||||
|
||||
def test_alias_multi_word(self):
|
||||
"""1445: Verify multi-word aliases"""
|
||||
self.t.config('alias.worktasks', 'list +work')
|
||||
self.t('add one +work')
|
||||
self.t('add two')
|
||||
code, out, err = self.t('worktasks')
|
||||
self.assertEqual(0, code, "Exit code was non-zero ({0})".format(code))
|
||||
self.assertIn('one', out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue