mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Unit Tests
- Added test to make sure that rc.default.command is used. - Added test to make sure that the 'information' command is used when there are ID/UUID args but no command.
This commit is contained in:
parent
eebe3b0806
commit
2f815a4c6a
1 changed files with 38 additions and 0 deletions
38
test/default.command.t
Executable file
38
test/default.command.t
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
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__)))
|
||||
|
||||
from basetest import Task, TestCase
|
||||
|
||||
|
||||
class TestCMD(TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.t = Task()
|
||||
cls.t.config("default.command", "list")
|
||||
|
||||
cls.t(('add', 'one'))
|
||||
cls.t(('add', 'two'))
|
||||
|
||||
def test_default_command(self):
|
||||
"""default command"""
|
||||
code, out, err = self.t(())
|
||||
self.assertIn("task list]", out)
|
||||
|
||||
def test_info_command(self):
|
||||
"""info command"""
|
||||
code, out, err = self.t(('1'))
|
||||
self.assertRegexpMatches(out, 'Description\s+one')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
||||
# vim: ai sts=4 et sw=4
|
Loading…
Add table
Add a link
Reference in a new issue