Commit c13c9fb9 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Import from own directory using the dot notation

'test' is not really a library that has to be imported
parent b8b816da
[settings]
skip=topydo/ui/CLIApplicationBase.py
known_first_party=topydo
......@@ -15,10 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from test.topydo_testcase import TopydoTest
from topydo.lib.Utils import escape_ansi
from .topydo_testcase import TopydoTest
class CommandTest(TopydoTest):
def __init__(self, *args, **kwargs):
......
......@@ -17,12 +17,13 @@
import unittest
from datetime import date
from io import StringIO
from test.command_testcase import CommandTest
from topydo.commands import AddCommand, ListCommand
from topydo.lib import TodoList
from topydo.lib.Config import config
from .command_testcase import CommandTest
# We're searching for 'mock'
# pylint: disable=no-name-in-module
try:
......
......@@ -16,11 +16,12 @@
import unittest
from datetime import date
from test.command_testcase import CommandTest
from topydo.commands.AppendCommand import AppendCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class AppendCommandTest(CommandTest):
def setUp(self):
......
......@@ -15,12 +15,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.ArchiveCommand import ArchiveCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
from .facilities import load_file_to_todolist
class ArchiveCommandTest(CommandTest):
def test_archive(self):
......
......@@ -17,12 +17,13 @@
""" Tests for the colorscheme functionality. """
import unittest
from test.topydo_testcase import TopydoTest
from topydo.lib.Color import Color
from topydo.lib.Config import config
from topydo.lib.Todo import Todo
from .topydo_testcase import TopydoTest
NEUTRAL_COLOR = '\033[0m'
......
......@@ -15,10 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
from .topydo_testcase import TopydoTest
class ConfigTest(TopydoTest):
def test_config01(self):
......
......@@ -15,13 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from topydo.commands.DeleteCommand import DeleteCommand
from topydo.lib.Config import config
from topydo.lib.TodoList import TodoList
from topydo.lib.TodoListBase import InvalidTodoException
from .command_testcase import CommandTest
def _yes_prompt(self):
return "y"
......
......@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from topydo.commands.DepCommand import DepCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class DepCommandTest(CommandTest):
def setUp(self):
......
......@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from topydo.commands.DepriCommand import DepriCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class DepriCommandTest(CommandTest):
def setUp(self):
......
......@@ -16,11 +16,12 @@
import unittest
from datetime import date, timedelta
from test.command_testcase import CommandTest
from topydo.commands.DoCommand import DoCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
def _yes_prompt(self):
return "y"
......
......@@ -16,13 +16,14 @@
import os
import unittest
from test.command_testcase import CommandTest
from topydo.commands.EditCommand import EditCommand
from topydo.lib.Config import config
from topydo.lib.Todo import Todo
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
# We're searching for 'mock'
# pylint: disable=no-name-in-module
try:
......
......@@ -18,13 +18,13 @@
import unittest
from datetime import date, timedelta
from test.facilities import (load_file, load_file_to_todolist,
todolist_to_string)
from test.topydo_testcase import TopydoTest
from topydo.lib import Filter
from topydo.lib.Todo import Todo
from .facilities import load_file, load_file_to_todolist, todolist_to_string
from .topydo_testcase import TopydoTest
class FilterTest(TopydoTest):
def test_filter03(self):
......
......@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.topydo_testcase import TopydoTest
from topydo.Commands import get_subcommand
from topydo.commands.AddCommand import AddCommand
......@@ -24,6 +23,8 @@ from topydo.commands.ListCommand import ListCommand
from topydo.commands.TagCommand import TagCommand
from topydo.lib.Config import ConfigError, config
from .topydo_testcase import TopydoTest
class GetSubcommandTest(TopydoTest):
def test_normal_cmd(self):
......
......@@ -15,10 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.topydo_testcase import TopydoTest
from topydo.lib.Graph import DirectedGraph
from .topydo_testcase import TopydoTest
class GraphTest(TopydoTest):
def setUp(self):
......
......@@ -16,7 +16,6 @@
import unittest
from datetime import date
from test.topydo_testcase import TopydoTest
from freezegun import freeze_time
......@@ -24,6 +23,8 @@ from topydo.lib.Config import config
from topydo.lib.Importance import importance
from topydo.lib.Todo import Todo
from .topydo_testcase import TopydoTest
@freeze_time("2015, 11, 06")
class ImportanceTest(TopydoTest):
......
......@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.topydo_testcase import TopydoTest
from topydo.lib.printers.Json import JsonPrinter
from topydo.lib.Todo import Todo
from .topydo_testcase import TopydoTest
class JsonPrinterTest(TopydoTest):
"""
......
......@@ -20,8 +20,6 @@ import re
import sys
import unittest
from collections import namedtuple
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from freezegun import freeze_time
......@@ -29,6 +27,9 @@ from topydo.commands.ListCommand import ListCommand
from topydo.lib.Config import config
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
from .facilities import load_file_to_todolist
# We're searching for 'mock'
# 'mock' was added as 'unittest.mock' in Python 3.3, but PyPy 3 is based on Python 3.2
# pylint: disable=no-name-in-module
......
......@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.ListContextCommand import ListContextCommand
from .command_testcase import CommandTest
from .facilities import load_file_to_todolist
class ListContextCommandTest(CommandTest):
def test_contexts1(self):
......
......@@ -16,8 +16,6 @@
import unittest
from collections import namedtuple
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from freezegun import freeze_time
......@@ -25,6 +23,9 @@ from topydo.commands.ListCommand import ListCommand
from topydo.lib.Config import config
from topydo.lib.TodoListBase import TodoListBase
from .command_testcase import CommandTest
from .facilities import load_file_to_todolist
# We're searching for 'mock'
# 'mock' was added as 'unittest.mock' in Python 3.3, but PyPy 3 is based on Python 3.2
# pylint: disable=no-name-in-module
......
......@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.ListProjectCommand import ListProjectCommand
from .command_testcase import CommandTest
from .facilities import load_file_to_todolist
class ListProjectCommandTest(CommandTest):
def test_projects1(self):
......
......@@ -16,11 +16,12 @@
import unittest
from datetime import date, timedelta
from test.command_testcase import CommandTest
from topydo.commands.PostponeCommand import PostponeCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class PostponeCommandTest(CommandTest):
def setUp(self):
......
......@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from topydo.commands.PriorityCommand import PriorityCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class PriorityCommandTest(CommandTest):
def setUp(self):
......
......@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.topydo_testcase import TopydoTest
from freezegun import freeze_time
......@@ -24,6 +23,8 @@ from topydo.lib.ProgressColor import progress_color
from topydo.lib.Todo import Todo
from topydo.lib.TodoList import TodoList
from .topydo_testcase import TopydoTest
def set_256_colors():
config(p_overrides={('topydo', 'colors'): '256'})
......
......@@ -16,12 +16,13 @@
import unittest
from datetime import date, timedelta
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
from topydo.lib.Recurrence import NoRecurrenceException, advance_recurring_todo
from topydo.lib.Todo import Todo
from .topydo_testcase import TopydoTest
class RecurrenceTest(TopydoTest):
def setUp(self):
......
......@@ -16,12 +16,13 @@
import unittest
from datetime import date
from test.topydo_testcase import TopydoTest
from freezegun import freeze_time
from topydo.lib.RelativeDate import relative_date_to_date
from .topydo_testcase import TopydoTest
@freeze_time('2015, 11, 06')
class RelativeDateTester(TopydoTest):
......
......@@ -19,7 +19,6 @@ import tempfile
import unittest
from datetime import date
from glob import glob
from test.command_testcase import CommandTest
from uuid import uuid4
from topydo.commands.AddCommand import AddCommand
......@@ -32,6 +31,8 @@ from topydo.lib.Config import config
from topydo.lib.TodoFile import TodoFile
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class RevertCommandTest(CommandTest):
def setUp(self):
......
......@@ -15,12 +15,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.SortCommand import SortCommand
from topydo.lib.Config import config
from .command_testcase import CommandTest
from .facilities import load_file_to_todolist
class SortCommandTest(CommandTest):
def setUp(self):
......
......@@ -15,15 +15,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.facilities import (load_file, load_file_to_todolist, print_view,
todolist_to_string)
from test.topydo_testcase import TopydoTest
from freezegun import freeze_time
from topydo.lib.Config import config
from topydo.lib.Sorter import Sorter
from .facilities import (load_file, load_file_to_todolist, print_view,
todolist_to_string)
from .topydo_testcase import TopydoTest
@freeze_time("2016, 04, 25")
class SorterTest(TopydoTest):
......
......@@ -15,13 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.command_testcase import CommandTest
from freezegun import freeze_time
from topydo.commands.TagCommand import TagCommand
from topydo.lib.TodoList import TodoList
from .command_testcase import CommandTest
class TagCommandTest(CommandTest):
def setUp(self):
......
......@@ -16,10 +16,11 @@
import unittest
from datetime import date, timedelta
from test.topydo_testcase import TopydoTest
from topydo.lib.Todo import Todo
from .topydo_testcase import TopydoTest
def today_date():
today = date.today()
......
......@@ -19,10 +19,11 @@
import re
import unittest
from datetime import date, timedelta
from test.topydo_testcase import TopydoTest
from topydo.lib.TodoBase import TodoBase
from .topydo_testcase import TopydoTest
class TodoBaseTester(TopydoTest):
def test_parse_tag(self):
......
......@@ -15,8 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.facilities import load_file
from test.topydo_testcase import TopydoTest
from .facilities import load_file
from .topydo_testcase import TopydoTest
class TodoFileTest(TopydoTest):
......
......@@ -18,7 +18,6 @@
import re
import unittest
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
from topydo.lib.Todo import Todo
......@@ -26,6 +25,8 @@ from topydo.lib.TodoFile import TodoFile
from topydo.lib.TodoList import TodoList
from topydo.lib.TodoListBase import InvalidTodoException, TodoListBase
from .topydo_testcase import TopydoTest
class TodoListTester(TopydoTest):
def setUp(self):
......
......@@ -15,10 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.topydo_testcase import TopydoTest
from topydo.lib.Utils import translate_key_to_config
from .topydo_testcase import TopydoTest
class UtilsTest(TopydoTest):
def test_key_to_cfg(self):
......
......@@ -15,14 +15,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from test.facilities import load_file, print_view, todolist_to_string
from test.topydo_testcase import TopydoTest
from topydo.lib import Filter
from topydo.lib.Sorter import Sorter
from topydo.lib.TodoFile import TodoFile
from topydo.lib.TodoList import TodoList
from .facilities import load_file, print_view, todolist_to_string
from .topydo_testcase import TopydoTest
class ViewTest(TopydoTest):
def test_view(self):
......
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