def test_can_set_tuple(self): config = self.make_section_config({}) save_mock = Mock() section = SectionConfig('Name', config, {}, save_mock) section.set('list', (1, 2)) self.assertEqual('1,2', config['list']) # Automatically saved value save_mock.assert_any_call()
def test_can_set_list(self): config = self.make_section_config({}) save_mock = Mock() section = SectionConfig('Name', config, {}, save_mock) section.set('list', [1, True, 'Hello']) self.assertEqual('1,True,Hello', config['list']) # Automatically saved value save_mock.assert_any_call()
def test_can_set_value(self): config = self.make_section_config({}) save_mock = Mock() section = SectionConfig('Name', config, {}, save_mock) section.set('option', 42) self.assertEqual('42', config['option']) # Automatically saved value save_mock.assert_any_call()
def test_can_set_tuple(self): config = self.make_section_config({}) save_mock = Mock() section = SectionConfig("Name", config, {}, save_mock) section.set("list", (1, 2)) self.assertEqual("1,2", config["list"]) # Automatically saved value save_mock.assert_any_call()
def test_can_set_list(self): config = self.make_section_config({}) save_mock = Mock() section = SectionConfig("Name", config, {}, save_mock) section.set("list", [1, True, "Hello"]) self.assertEqual("1,True,Hello", config["list"]) # Automatically saved value save_mock.assert_any_call()
def test_can_set_value(self): config = self.make_section_config({}) save_mock = Mock() section = SectionConfig("Name", config, {}, save_mock) section.set("option", 42) self.assertEqual("42", config["option"]) # Automatically saved value save_mock.assert_any_call()