summaryrefslogtreecommitdiffstats
path: root/tests/other/test_configparser.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-10-13 21:39:58 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-10-13 21:39:58 +0200
commit7e7adc64713f74976d5994af36b5f758620fb37b (patch)
tree868084317f8818dbb327c76eaff3c7c7edce0231 /tests/other/test_configparser.py
parentfixed JsEngine init (diff)
downloadpyload-7e7adc64713f74976d5994af36b5f758620fb37b.tar.xz
added JSON and WS client, re organized tests, new classes for easier api tests
Diffstat (limited to 'tests/other/test_configparser.py')
-rw-r--r--tests/other/test_configparser.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/other/test_configparser.py b/tests/other/test_configparser.py
new file mode 100644
index 000000000..acb05c63e
--- /dev/null
+++ b/tests/other/test_configparser.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+
+from collections import defaultdict
+from tests.helper.Stubs import Core
+
+from module.database import DatabaseBackend
+from module.config.ConfigParser import ConfigParser
+
+# TODO
+class TestConfigParser():
+
+ db = None
+
+ @classmethod
+ def setUpClass(cls):
+ cls.db = DatabaseBackend(Core())
+ cls.db.manager = cls.db.core
+ cls.db.manager.statusMsg = defaultdict(lambda: "statusmsg")
+ cls.config = ConfigParser()
+ cls.db.setup()
+ cls.db.clearAllConfigs()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.db.shutdown()
+
+ def test_db(self):
+
+ 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):
+
+ assert self.config["general"]["language"]
+ self.config["general"]["language"] = "de"
+ assert self.config["general"]["language"] == "de"
+
+ def test_config(self):
+ pass
+
+ def test_userconfig(self):
+ pass \ No newline at end of file