Changeset 7424cf


Ignore:
Timestamp:
05/09/2013 09:29:04 PM (12 years ago)
Author:
Calum Lind <calumlind+deluge@gmail.com>
Branches:
2.0.x, develop, master
Children:
bf77f4
Parents:
b6a3161
Message:

Fix error in previous commit (b6a3161) and added test

Location:
deluge
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • deluge/core/core.py

    rb6a3161 r7424cf  
    486486    def get_config_values(self, keys):
    487487        """Get the config values for the entered keys"""
    488         return {(key, self.config.get(key)) for key in keys}
     488        return dict((key, self.config.get(key)) for key in keys)
    489489
    490490    @export
  • deluge/tests/test_core.py

    rb6a3161 r7424cf  
    202202            self.assertEquals(deluge.core.torrent.sanitize_filepath(key, folder=False), pathlist[key])
    203203            self.assertEquals(deluge.core.torrent.sanitize_filepath(key, folder=True), pathlist[key] + '/')
     204
     205    def test_get_set_config_values(self):
     206        self.assertEquals(self.core.get_config_values(["abc", "foo"]), {"foo": None, "abc": None})
     207        self.assertEquals(self.core.get_config_value("foobar"), None)
     208        self.core.set_config({"abc": "def", "foo": 10, "foobar": "barfoo"})
     209        self.assertEquals(self.core.get_config_values(["foo", "abc"]), {"foo": 10, "abc": "def"})
     210        self.assertEquals(self.core.get_config_value("foobar"), "barfoo")
Note: See TracChangeset for help on using the changeset viewer.