示例#1
0
 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()
示例#2
0
 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()
示例#3
0
 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()
示例#4
0
 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()
示例#5
0
 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()
示例#6
0
 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()