コード例 #1
0
 def test_can_set_options_set_in_user_config(self):
     another_path = tempfile.mkdtemp()
     fake_read_user = lambda _: {"electrum_sv_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_sv_path", another_path)
     self.assertEqual(another_path, config.get("electrum_sv_path"))
コード例 #2
0
 def test_cannot_set_options_passed_by_command_line(self):
     fake_read_user = lambda _: {"electrum_sv_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_sv_path", "c")
     self.assertEqual(self.options.get("electrum_sv_path"),
                      config.get("electrum_sv_path"))