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 ...@@ -22,6 +22,7 @@ from topydo.lib import TodoList
class AddCommandTest(CommandTest.CommandTest): class AddCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(AddCommandTest, self).setUp()
self.todolist = TodoList.TodoList([]) self.todolist = TodoList.TodoList([])
self.today = date.today().isoformat() self.today = date.today().isoformat()
......
...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList ...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class AppendCommandTest(CommandTest.CommandTest): class AppendCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(AppendCommandTest, self).setUp()
self.todolist = TodoList([]) self.todolist = TodoList([])
self.todolist.add("Foo") self.todolist.add("Foo")
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
import unittest import unittest
from topydo.lib.Config import config
from topydo.lib.Utils import escape_ansi from topydo.lib.Utils import escape_ansi
class CommandTest(unittest.TestCase): class CommandTest(unittest.TestCase):
...@@ -24,6 +25,9 @@ class CommandTest(unittest.TestCase): ...@@ -24,6 +25,9 @@ class CommandTest(unittest.TestCase):
self.output = "" self.output = ""
self.errors = "" self.errors = ""
def setUp(self):
config("")
def out(self, p_output): def out(self, p_output):
if p_output: if p_output:
self.output += escape_ansi(p_output + "\n") self.output += escape_ansi(p_output + "\n")
......
...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList ...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class DeleteCommandTest(CommandTest.CommandTest): class DeleteCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(DeleteCommandTest, self).setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1", "Bar p:1",
......
...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList ...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class DepCommandTest(CommandTest.CommandTest): class DepCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(DepCommandTest, self).setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1", "Bar p:1",
......
...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList ...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class DepriCommandTest(CommandTest.CommandTest): class DepriCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(DepriCommandTest, self).setUp()
todos = [ todos = [
"(A) Foo", "(A) Foo",
"Bar", "Bar",
......
...@@ -28,6 +28,7 @@ def _no_prompt(self): ...@@ -28,6 +28,7 @@ def _no_prompt(self):
class DoCommandTest(CommandTest.CommandTest): class DoCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(DoCommandTest, self).setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1", "Bar p:1",
......
...@@ -21,6 +21,7 @@ import TestFacilities ...@@ -21,6 +21,7 @@ import TestFacilities
class ListCommandTest(CommandTest.CommandTest): class ListCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(ListCommandTest, self).setUp()
self.todolist = TestFacilities.load_file_to_todolist("data/ListCommandTest.txt") self.todolist = TestFacilities.load_file_to_todolist("data/ListCommandTest.txt")
def tearDown(self): def tearDown(self):
......
...@@ -22,6 +22,7 @@ from topydo.lib.TodoList import TodoList ...@@ -22,6 +22,7 @@ from topydo.lib.TodoList import TodoList
class PostponeCommandTest(CommandTest.CommandTest): class PostponeCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(PostponeCommandTest, self).setUp()
self.today = date.today() self.today = date.today()
self.past = date.today() - timedelta(1) self.past = date.today() - timedelta(1)
self.future = date.today() + timedelta(1) self.future = date.today() + timedelta(1)
...@@ -57,7 +58,7 @@ class PostponeCommandTest(CommandTest.CommandTest): ...@@ -57,7 +58,7 @@ class PostponeCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty()) self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.output, " 2 Bar due:%s\n" % due.isoformat()) self.assertEquals(self.output, " 2 Bar due:%s\n" % due.isoformat())
self.assertEquals(self.errors, "") self.assertEquals(self.errors, "")
def test_postpone3(self): def test_postpone3(self):
command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out, self.error) command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out, self.error)
command.execute() command.execute()
......
...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList ...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class PriorityCommandTest(CommandTest.CommandTest): class PriorityCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(PriorityCommandTest, self).setUp()
todos = [ todos = [
"(A) Foo", "(A) Foo",
"Bar", "Bar",
......
...@@ -20,6 +20,7 @@ import TestFacilities ...@@ -20,6 +20,7 @@ import TestFacilities
class SortCommandTest(CommandTest.CommandTest): class SortCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(SortCommandTest, self).setUp()
self.todolist = TestFacilities.load_file_to_todolist("data/SorterTest1.txt") self.todolist = TestFacilities.load_file_to_todolist("data/SorterTest1.txt")
def test_sort1(self): def test_sort1(self):
......
...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList ...@@ -20,6 +20,7 @@ from topydo.lib.TodoList import TodoList
class TagCommandTest(CommandTest.CommandTest): class TagCommandTest(CommandTest.CommandTest):
def setUp(self): def setUp(self):
super(TagCommandTest, self).setUp()
todos = [ todos = [
"Foo", "Foo",
"Bar due:2014-10-22", "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