summaryrefslogtreecommitdiffstats
path: root/tests/helper/Stubs.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-02 18:11:31 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-02 18:11:31 +0100
commit6b20f5f6c063e4e6c94d719b607ad5a028b8beee (patch)
treea8c3dfa9962aa819507870553700a35b7dcc4c74 /tests/helper/Stubs.py
parentRemove '/' from filename to avoid filepath exception (diff)
downloadpyload-6b20f5f6c063e4e6c94d719b607ad5a028b8beee.tar.xz
new configManager for multi user configs
Diffstat (limited to 'tests/helper/Stubs.py')
-rw-r--r--tests/helper/Stubs.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/helper/Stubs.py b/tests/helper/Stubs.py
index 4ebd12592..f0e8d0614 100644
--- a/tests/helper/Stubs.py
+++ b/tests/helper/Stubs.py
@@ -11,6 +11,8 @@ sys.path.append(abspath(join(dirname(__file__), "..", "..")))
import __builtin__
+from module.Api import Role
+from module.datatypes.User import User
from module.datatypes.PyPackage import PyPackage
from module.threads.BaseThread import BaseThread
from module.config.ConfigParser import ConfigParser
@@ -69,7 +71,8 @@ class Core:
__builtin__.pyreq = self.requestFactory
self.accountManager = AccountManager()
self.addonManager = AddonManager()
- self.eventManager = self.interActionManager = NoopClass()
+ self.eventManager = self.evm = NoopClass()
+ self.interActionManager = self.im = NoopClass()
self.js = JsEngine()
self.cache = {}
self.packageCache = {}
@@ -95,7 +98,7 @@ class Core:
def getPackage(self, id):
return PyPackage(self, 0, "tmp", "tmp", "", "", 0, 0)
-
+
def print_exc(self):
log(ERROR, format_exc())
@@ -104,15 +107,17 @@ class NoopClass:
def __getattr__(self, item):
return noop
+
class AddonManager(NoopClass):
def activePlugins(self):
return []
-class AccountManager:
+class AccountManager:
def getAccountForPlugin(self, name):
return None
+
class Thread(BaseThread):
def __init__(self, core):
BaseThread.__init__(self, core)
@@ -131,3 +136,6 @@ __builtin__._ = lambda x: x
__builtin__.pypath = abspath(join(dirname(__file__), "..", ".."))
__builtin__.addonManager = AddonManager()
__builtin__.pyreq = None
+
+adminUser = User(None, uid=0, role=Role.Admin)
+normalUser = User(None, uid=1, role=Role.User) \ No newline at end of file