diff --git a/deluge/core/core.py b/deluge/core/core.py index 2347f7786..8637670b2 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -485,7 +485,7 @@ class Core(component.Component): @export def get_config_values(self, keys): """Get the config values for the entered keys""" - return {(key, self.config.get(key)) for key in keys} + return dict((key, self.config.get(key)) for key in keys) @export def set_config(self, config): diff --git a/deluge/tests/test_core.py b/deluge/tests/test_core.py index 4c4f16f51..38f4fdac2 100644 --- a/deluge/tests/test_core.py +++ b/deluge/tests/test_core.py @@ -201,3 +201,10 @@ class CoreTestCase(unittest.TestCase): for key in pathlist: self.assertEquals(deluge.core.torrent.sanitize_filepath(key, folder=False), pathlist[key]) self.assertEquals(deluge.core.torrent.sanitize_filepath(key, folder=True), pathlist[key] + '/') + + def test_get_set_config_values(self): + self.assertEquals(self.core.get_config_values(["abc", "foo"]), {"foo": None, "abc": None}) + self.assertEquals(self.core.get_config_value("foobar"), None) + self.core.set_config({"abc": "def", "foo": 10, "foobar": "barfoo"}) + self.assertEquals(self.core.get_config_values(["foo", "abc"]), {"foo": 10, "abc": "def"}) + self.assertEquals(self.core.get_config_value("foobar"), "barfoo")