Commit 620b5a1f authored by Bram Schoenmakers's avatar Bram Schoenmakers

Prevent reading user-defined configuration values for testcases.

parent 8b4e11d2
......@@ -22,6 +22,7 @@ from topydo.lib import TodoList
class AddCommandTest(CommandTest.CommandTest):
def setUp(self):
super(AddCommandTest, self).setUp()
self.todolist = TodoList.TodoList([])
self.today = date.today().isoformat()
......
......@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class AppendCommandTest(CommandTest.CommandTest):
def setUp(self):
super(AppendCommandTest, self).setUp()
self.todolist = TodoList([])
self.todolist.add("Foo")
......
......@@ -16,6 +16,7 @@
import unittest
from topydo.lib.Config import config
from topydo.lib.Utils import escape_ansi
class CommandTest(unittest.TestCase):
......@@ -24,6 +25,9 @@ class CommandTest(unittest.TestCase):
self.output = ""
self.errors = ""
def setUp(self):
config("")
def out(self, p_output):
if p_output:
self.output += escape_ansi(p_output + "\n")
......
......@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class DeleteCommandTest(CommandTest.CommandTest):
def setUp(self):
super(DeleteCommandTest, self).setUp()
todos = [
"Foo id:1",
"Bar p:1",
......
......@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class DepCommandTest(CommandTest.CommandTest):
def setUp(self):
super(DepCommandTest, self).setUp()
todos = [
"Foo id:1",
"Bar p:1",
......
......@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class DepriCommandTest(CommandTest.CommandTest):
def setUp(self):
super(DepriCommandTest, self).setUp()
todos = [
"(A) Foo",
"Bar",
......
......@@ -28,6 +28,7 @@ def _no_prompt(self):
class DoCommandTest(CommandTest.CommandTest):
def setUp(self):
super(DoCommandTest, self).setUp()
todos = [
"Foo id:1",
"Bar p:1",
......
......@@ -21,6 +21,7 @@ import TestFacilities
class ListCommandTest(CommandTest.CommandTest):
def setUp(self):
super(ListCommandTest, self).setUp()
self.todolist = TestFacilities.load_file_to_todolist("data/ListCommandTest.txt")
def tearDown(self):
......
......@@ -22,6 +22,7 @@ from topydo.lib.TodoList import TodoList
class PostponeCommandTest(CommandTest.CommandTest):
def setUp(self):
super(PostponeCommandTest, self).setUp()
self.today = date.today()
self.past = date.today() - timedelta(1)
self.future = date.today() + timedelta(1)
......@@ -57,7 +58,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 Bar due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "")
def test_postpone3(self):
command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out, self.error)
command.execute()
......
......@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class PriorityCommandTest(CommandTest.CommandTest):
def setUp(self):
super(PriorityCommandTest, self).setUp()
todos = [
"(A) Foo",
"Bar",
......
......@@ -20,6 +20,7 @@ import TestFacilities
class SortCommandTest(CommandTest.CommandTest):
def setUp(self):
super(SortCommandTest, self).setUp()
self.todolist = TestFacilities.load_file_to_todolist("data/SorterTest1.txt")
def test_sort1(self):
......
......@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class TagCommandTest(CommandTest.CommandTest):
def setUp(self):
super(TagCommandTest, self).setUp()
todos = [
"Foo",
"Bar due:2014-10-22",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment