From 453c1e55c71a96c9529ecdca1d55278cc41088d6 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 18 Jan 2014 18:45:13 +0100 Subject: rewritten download scheduling, improved account manager, db version increased all data will be overwritten --- tests/helper/Stubs.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests/helper/Stubs.py') diff --git a/tests/helper/Stubs.py b/tests/helper/Stubs.py index 3541e4ffb..4bb8ade9e 100644 --- a/tests/helper/Stubs.py +++ b/tests/helper/Stubs.py @@ -1,20 +1,22 @@ # -*- coding: utf-8 -*- +import sys from os.path import join from time import strftime from traceback import format_exc import __builtin__ +from pyload.InitHomeDir import init_dir + +init_dir(join("tests", "config"), True) + from pyload.Api import Role from pyload.Core import Core -from pyload.InitHomeDir import init_dir from pyload.datatypes.User import User from pyload.threads.BaseThread import BaseThread from pyload.config.ConfigParser import ConfigParser -init_dir(join("tests", "config")) - from logging import log, DEBUG, INFO, WARN, ERROR # Do nothing @@ -94,3 +96,9 @@ adminUser = User(None, uid=0, role=Role.Admin) normalUser = User(None, uid=1, role=Role.User) otherUser = User(None, uid=2, role=Role.User) +# fixes the module paths because we changed the directory +for name, m in sys.modules.iteritems(): + if not name.startswith("tests") or not m or not hasattr(m, "__path__"): + continue + + m.__path__[0] = join("..", "..", m.__path__[0]) \ No newline at end of file -- cgit v1.2.3