mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
[#2510] [Tests] Add config test for overwriting None value
This commit is contained in:
parent
dd8e37a6ce
commit
3b950094af
1 changed files with 21 additions and 0 deletions
|
@ -44,6 +44,27 @@ class ConfigTestCase(unittest.TestCase):
|
||||||
|
|
||||||
config._save_timer.cancel()
|
config._save_timer.cancel()
|
||||||
|
|
||||||
|
def test_set_get_item_none(self):
|
||||||
|
config = Config("test.conf", config_dir=self.config_dir)
|
||||||
|
|
||||||
|
config["foo"] = None
|
||||||
|
self.assertIsNone(config["foo"])
|
||||||
|
self.assertIsInstance(config["foo"], type(None))
|
||||||
|
|
||||||
|
config["foo"] = 1
|
||||||
|
self.assertEquals(config.get("foo"), 1)
|
||||||
|
|
||||||
|
config["foo"] = None
|
||||||
|
self.assertIsNone(config["foo"])
|
||||||
|
|
||||||
|
config["bar"] = None
|
||||||
|
self.assertIsNone(config["bar"])
|
||||||
|
|
||||||
|
config["bar"] = None
|
||||||
|
self.assertIsNone(config["bar"])
|
||||||
|
|
||||||
|
config._save_timer.cancel()
|
||||||
|
|
||||||
def test_get(self):
|
def test_get(self):
|
||||||
config = Config("test.conf", config_dir=self.config_dir)
|
config = Config("test.conf", config_dir=self.config_dir)
|
||||||
config["foo"] = 1
|
config["foo"] = 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue