def test_can_set_options_set_in_user_config(self): another_path = tempfile.mkdtemp() fake_read_user = lambda _: {"electrum_path": self.electrum_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("electrum_path", another_path) self.assertEqual(another_path, config.get("electrum_path"))
def test_cannot_set_options_passed_by_command_line(self): fake_read_user = lambda _: {"electrum_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("electrum_path", "c") self.assertEqual(self.options.get("electrum_path"), config.get("electrum_path"))