Tests: Speed up filter.t

- None of the tests in filter.t write data.  Make use of that by
  setting up task data once for all included tests.
This commit is contained in:
Wilhelm Schuermann 2015-05-07 17:23:14 +02:00
parent 3a7af017f8
commit 69698454c3

View file

@ -36,16 +36,17 @@ from basetest import Task, TestCase
class TestFilter(TestCase):
def setUp(self):
self.t = Task()
@classmethod
def setUpClass(cls):
cls.t = Task()
self.t(("add", "project:A", "prio:H", "+tag", "one", "foo"))
self.t(("add", "project:A", "prio:H", "two"))
self.t(("add", "project:A", "three"))
self.t(("add", "prio:H", "four"))
self.t(("add", "+tag", "five"))
self.t(("add", "six", "foo"))
self.t(("add", "prio:L", "seven", "bar", "foo"))
cls.t(("add", "project:A", "prio:H", "+tag", "one", "foo"))
cls.t(("add", "project:A", "prio:H", "two"))
cls.t(("add", "project:A", "three"))
cls.t(("add", "prio:H", "four"))
cls.t(("add", "+tag", "five"))
cls.t(("add", "six", "foo"))
cls.t(("add", "prio:L", "seven", "bar", "foo"))
def test_list(self):
"""filter - list"""