Test: Added _aliases command test

This commit is contained in:
Paul Beckingham 2015-07-17 21:08:05 -04:00
parent bf0b074f45
commit 5090a7d730

View file

@ -38,8 +38,6 @@ from basetest import Task, TestCase
class TestAlias(TestCase): class TestAlias(TestCase):
def setUp(self): def setUp(self):
"""Executed before each test in the class""" """Executed before each test in the class"""
# Used to initialize objects that should be re-initialized or
# re-created for each individual test
self.t = Task() self.t = Task()
def test_simple_alias_to_project(self): def test_simple_alias_to_project(self):
@ -133,6 +131,18 @@ class TestAlias(TestCase):
msg="task hometoday -> project:Home and due:today minimal > " msg="task hometoday -> project:Home and due:today minimal > "
"Work task") "Work task")
class TestAliasesCommand(TestCase):
def setUp(self):
"""Executed before each test in the class"""
self.t = Task()
def test_aliases_helper(self):
"""Verify that aliases are listed by the _aliases command"""
self.t.config("alias.foo", "bar")
code, out, err = self.t("_aliases")
self.assertIn("foo", out)
if __name__ == "__main__": if __name__ == "__main__":
from simpletap import TAPTestRunner from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner()) unittest.main(testRunner=TAPTestRunner())