diff --git a/radicale/tests/__init__.py b/radicale/tests/__init__.py index f23b891..475d4b2 100644 --- a/radicale/tests/__init__.py +++ b/radicale/tests/__init__.py @@ -48,8 +48,6 @@ def finish_request_cov(self, request, client_address): server.ParallelHTTPServer.finish_request = finish_request_cov -# Allow importing of tests.custom.... -sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) # Enable debug output radicale.log.logger.setLevel(logging.DEBUG) diff --git a/radicale/tests/test_auth.py b/radicale/tests/test_auth.py index 884b3a2..4b1df4d 100644 --- a/radicale/tests/test_auth.py +++ b/radicale/tests/test_auth.py @@ -29,8 +29,7 @@ import tempfile import pytest from radicale import Application, config - -from .test_base import BaseTest +from radicale.tests.test_base import BaseTest class TestBaseAuthRequests(BaseTest): @@ -162,7 +161,7 @@ class TestBaseAuthRequests(BaseTest): def test_custom(self): """Custom authentication.""" self.configuration.update( - {"auth": {"type": "tests.custom.auth"}}, "test") + {"auth": {"type": "radicale.tests.custom.auth"}}, "test") self.application = Application(self.configuration) status, _, answer = self.request( "PROPFIND", "/tmp", HTTP_AUTHORIZATION="Basic %s" % diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index b1f33fa..f8f21f7 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -32,9 +32,8 @@ from functools import partial import pytest from radicale import Application, config, storage - -from . import BaseTest -from .helpers import get_file_content +from radicale.tests import BaseTest +from radicale.tests.helpers import get_file_content class BaseRequestsMixIn: @@ -1632,7 +1631,7 @@ class TestMultiFileSystem(BaseFileSystemTest, BaseRequestsMixIn): class TestCustomStorageSystem(BaseFileSystemTest): """Test custom backend loading.""" - storage_type = "tests.custom.storage_simple_sync" + storage_type = "radicale.tests.custom.storage_simple_sync" full_sync_token_support = False _report_sync_token = BaseRequestsMixIn._report_sync_token test_root = BaseRequestsMixIn.test_root diff --git a/radicale/tests/test_config.py b/radicale/tests/test_config.py index 2e0b05e..f8b7d6a 100644 --- a/radicale/tests/test_config.py +++ b/radicale/tests/test_config.py @@ -22,8 +22,7 @@ from configparser import RawConfigParser import pytest from radicale import config - -from .helpers import configuration_to_dict +from radicale.tests.helpers import configuration_to_dict class TestConfig: diff --git a/radicale/tests/test_rights.py b/radicale/tests/test_rights.py index 67ed812..75aa0e2 100644 --- a/radicale/tests/test_rights.py +++ b/radicale/tests/test_rights.py @@ -24,9 +24,8 @@ import shutil import tempfile from radicale import Application, config - -from .helpers import get_file_content -from .test_base import BaseTest +from radicale.tests.helpers import get_file_content +from radicale.tests.test_base import BaseTest class TestBaseRightsRequests(BaseTest): @@ -144,8 +143,8 @@ permissions: Rr""") def test_custom(self): """Custom rights management.""" - self._test_rights("tests.custom.rights", "", "/", "r", 401) - self._test_rights("tests.custom.rights", "", "/tmp", "r", 207) + self._test_rights("radicale.tests.custom.rights", "", "/", "r", 401) + self._test_rights("radicale.tests.custom.rights", "", "/tmp", "r", 207) def test_collections_and_items(self): """Test rights for creation of collections, calendars and items. diff --git a/radicale/tests/test_server.py b/radicale/tests/test_server.py index 52d9f93..2368995 100644 --- a/radicale/tests/test_server.py +++ b/radicale/tests/test_server.py @@ -35,8 +35,7 @@ from urllib.error import HTTPError, URLError import pytest from radicale import config, server - -from .helpers import configuration_to_dict, get_file_path +from radicale.tests.helpers import configuration_to_dict, get_file_path try: import gunicorn diff --git a/radicale/tests/test_web.py b/radicale/tests/test_web.py index db1bcad..516e381 100644 --- a/radicale/tests/test_web.py +++ b/radicale/tests/test_web.py @@ -23,8 +23,7 @@ import shutil import tempfile from radicale import Application, config - -from .test_base import BaseTest +from radicale.tests.test_base import BaseTest class TestBaseWebRequests(BaseTest): @@ -62,7 +61,7 @@ class TestBaseWebRequests(BaseTest): def test_custom(self): """Custom web plugin.""" self.configuration.update({ - "web": {"type": "tests.custom.web"}}, "test") + "web": {"type": "radicale.tests.custom.web"}}, "test") self.application = Application(self.configuration) status, _, answer = self.request("GET", "/.web") assert status == 200