mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Test: Corrected test
This commit is contained in:
parent
239cf2d848
commit
050aad49f2
1 changed files with 18 additions and 14 deletions
|
@ -36,25 +36,29 @@ from basetest import Task, TestCase
|
|||
|
||||
|
||||
class TestIDPosition(TestCase):
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
self.t = Task()
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Executed once before any test in the class"""
|
||||
cls.t = Task()
|
||||
|
||||
self.t(("add", "one"))
|
||||
self.t(("add", "two"))
|
||||
|
||||
def test_id(self):
|
||||
"""Test id before and after command"""
|
||||
code, out, err = self.t(("list",))
|
||||
cls.t(("add", "one"))
|
||||
cls.t(("add", "two"))
|
||||
|
||||
def test_id_read_cmd(self):
|
||||
"""Test id before and after read command"""
|
||||
code, out, err = self.t(("1", "info"))
|
||||
self.assertIn("one", out)
|
||||
self.assertIn("two", out)
|
||||
self.assertNotIn("two", out)
|
||||
|
||||
code, out, err = self.t(("1", "done"))
|
||||
self.assertIn("Completed 1 task.", out)
|
||||
code, out, err = self.t(("info", "1"))
|
||||
self.assertIn("one", out)
|
||||
self.assertNotIn("two", out)
|
||||
|
||||
def test_id_write_cmd(self):
|
||||
"""Test id before write command"""
|
||||
code, out, err = self.t(("2", "done"))
|
||||
self.assertIn("Completed task 2", out)
|
||||
|
||||
code, out, err = self.t(("done", "2"))
|
||||
self.assertIn("Completed 1 task.", out)
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue