feat: load rpc server config

This commit is contained in:
lda
2026-06-03 08:39:44 +07:00 Verified
parent 673c99a70f
commit 14183a9eb6
2 changed files with 72 additions and 8 deletions
+29
View File
@@ -12,3 +12,32 @@ def test_rpc_server_cli_help_mentions_store_root() -> None:
assert "--store-root" in result.output
assert "--host" in result.output
assert "--port" in result.output
import json
def test_rpc_server_cli_accepts_config_file(tmp_path) -> None:
config_path = tmp_path / "wf.json"
config_path.write_text(
json.dumps(
{
"version": 1,
"server": {
"store": {"kind": "filesystem", "root": ".wf_store"},
"transports": [
{
"kind": "rpc_http",
"host": "127.0.0.1",
"port": 9999,
"path": "/rpc",
}
],
},
}
),
encoding="utf-8",
)
result = CliRunner().invoke(app, ["--config", str(config_path), "--help"])
assert result.exit_code == 0
assert "--config" in result.output