From 6c9976f46a6cd1113b1e74cd4887d46063513fcd Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 25 Sep 2013 13:44:08 +0200 Subject: [PATCH] Import storage modules after configuration in tests --- tests/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 5b067ba..59ec2af 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -39,7 +39,6 @@ os.environ["RADICALE_CONFIG"] = os.path.join(os.path.dirname( from radicale import config from radicale.auth import htpasswd -from radicale.storage import filesystem, database from .helpers import get_file_content from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine @@ -84,6 +83,7 @@ class FileSystem(BaseTest): """Setup function for each test.""" self.colpath = tempfile.mkdtemp() config.set("storage", "type", self.storage_type) + from radicale.storage import filesystem filesystem.FOLDER = self.colpath filesystem.GIT_REPOSITORY = None self.application = radicale.Application() @@ -103,6 +103,7 @@ class DataBaseSystem(BaseTest): def setup(self): config.set("storage", "type", "database") config.set("storage", "database_url", "sqlite://") + from radicale.storage import database database.Session = sessionmaker() database.Session.configure(bind=create_engine("sqlite://")) session = database.Session() @@ -118,6 +119,7 @@ class GitFileSystem(FileSystem): def setup(self): super(GitFileSystem, self).setup() Repo.init(self.colpath) + from radicale.storage import filesystem filesystem.GIT_REPOSITORY = Repo(self.colpath)