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):
|
class TestIDPosition(TestCase):
|
||||||
def setUp(self):
|
@classmethod
|
||||||
"""Executed before each test in the class"""
|
def setUpClass(cls):
|
||||||
self.t = Task()
|
"""Executed once before any test in the class"""
|
||||||
|
cls.t = Task()
|
||||||
|
|
||||||
self.t(("add", "one"))
|
cls.t(("add", "one"))
|
||||||
self.t(("add", "two"))
|
cls.t(("add", "two"))
|
||||||
|
|
||||||
def test_id(self):
|
|
||||||
"""Test id before and after command"""
|
|
||||||
code, out, err = self.t(("list",))
|
|
||||||
|
|
||||||
|
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("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
|
||||||
code, out, err = self.t(("1", "done"))
|
code, out, err = self.t(("info", "1"))
|
||||||
self.assertIn("Completed 1 task.", out)
|
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__":
|
if __name__ == "__main__":
|
||||||
from simpletap import TAPTestRunner
|
from simpletap import TAPTestRunner
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue