Exemple #1
0
 def test_can_set_options_set_in_user_config(self):
     another_path = tempfile.mkdtemp()
     fake_read_user = lambda _: {"electrumsys_path": self.electrumsys_dir}
     read_user_dir = lambda: self.user_dir
     config = SimpleConfig(options={},
                           read_user_config_function=fake_read_user,
                           read_user_dir_function=read_user_dir)
     config.set_key("electrumsys_path", another_path)
     self.assertEqual(another_path, config.get("electrumsys_path"))
Exemple #2
0
 def test_cannot_set_options_passed_by_command_line(self):
     fake_read_user = lambda _: {"electrumsys_path": "b"}
     read_user_dir = lambda: self.user_dir
     config = SimpleConfig(options=self.options,
                           read_user_config_function=fake_read_user,
                           read_user_dir_function=read_user_dir)
     config.set_key("electrumsys_path", "c")
     self.assertEqual(self.options.get("electrumsys_path"),
                      config.get("electrumsys_path"))