diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/helper/Stubs.py | 2 | ||||
-rw-r--r-- | tests/test_configparser.py | 24 |
2 files changed, 22 insertions, 4 deletions
diff --git a/tests/helper/Stubs.py b/tests/helper/Stubs.py index ac4a41605..5c44cfb58 100644 --- a/tests/helper/Stubs.py +++ b/tests/helper/Stubs.py @@ -14,7 +14,7 @@ from module.datatypes.PyPackage import PyPackage from module.threads.BaseThread import BaseThread from module.config.ConfigParser import ConfigParser from module.network.RequestFactory import RequestFactory -from module.plugins.PluginManager import PluginManager +from module.PluginManager import PluginManager from module.common.JsEngine import JsEngine from logging import log, DEBUG, INFO, WARN, ERROR diff --git a/tests/test_configparser.py b/tests/test_configparser.py index 29ba9e51b..d797c7912 100644 --- a/tests/test_configparser.py +++ b/tests/test_configparser.py @@ -14,14 +14,32 @@ class TestConfigParser(): cls.db = DatabaseBackend(Core()) cls.db.manager = cls.db.core cls.db.manager.statusMsg = defaultdict(lambda: "statusmsg") - cls.config = ConfigParser + cls.config = ConfigParser() + cls.db.setup() + cls.db.clearAllConfigs() def test_db(self): - pass + + self.db.saveConfig("plugin", "some value", 0) + self.db.saveConfig("plugin", "some other value", 1) + + assert self.db.loadConfig("plugin", 0) == "some value" + assert self.db.loadConfig("plugin", 1) == "some other value" + + d = self.db.loadAllConfigs() + assert d[0]["plugin"] == "some value" + + self.db.deleteConfig("plugin") + + assert not self.db.loadAllConfigs() + def test_dict(self): - pass + + assert self.config["general"]["language"] + self.config["general"]["language"] = "de" + assert self.config["general"]["language"] == "de" def test_config(self): pass |