From 050aad49f2c3b048ef095f8ebc738042aa3765b0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 28 Jun 2015 00:15:53 -0400 Subject: [PATCH] Test: Corrected test --- test/args.1.t | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/test/args.1.t b/test/args.1.t index 4c12269c7..91c370ea2 100755 --- a/test/args.1.t +++ b/test/args.1.t @@ -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